From 64047ef5776750c3b16f0668da0239a5b0f24897 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 10 Jun 2025 17:48:36 -0400 Subject: [PATCH] TOKU: FIX: exceptions --- app/src/Service/Venta/MediosPago/Toku/Invoice.php | 5 +++-- app/src/Service/Venta/MediosPago/Toku/Subscription.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/Service/Venta/MediosPago/Toku/Invoice.php b/app/src/Service/Venta/MediosPago/Toku/Invoice.php index a3d3296..9f70d2e 100644 --- a/app/src/Service/Venta/MediosPago/Toku/Invoice.php +++ b/app/src/Service/Venta/MediosPago/Toku/Invoice.php @@ -4,7 +4,9 @@ namespace Incoviba\Service\Venta\MediosPago\Toku; use DateMalformedStringException; use DateTimeImmutable; use DateTimeZone; +use PDOException; use Psr\Http\Client\ClientInterface; +use Psr\Log\LoggerInterface; use Incoviba\Common\Implement\Exception\EmptyResponse; use Incoviba\Common\Implement\Exception\EmptyResult; use Incoviba\Exception\InvalidResult; @@ -13,7 +15,6 @@ use Incoviba\Repository; use Incoviba\Service\UF; use Incoviba\Service\Venta\MediosPago\AbstractEndPoint; use Incoviba\Service\Venta\Pago; -use Psr\Log\LoggerInterface; class Invoice extends AbstractEndPoint { @@ -68,7 +69,7 @@ class Invoice extends AbstractEndPoint try { $this->delete($tokuId); $this->invoiceRepository->removeByTokuId($tokuId); - } catch (EmptyResponse $exception) { + } catch (EmptyResponse | PDOException $exception) { $this->logger->warning($exception, ['invoice->toku_id' => $tokuId]); } } diff --git a/app/src/Service/Venta/MediosPago/Toku/Subscription.php b/app/src/Service/Venta/MediosPago/Toku/Subscription.php index d572e73..f0d9126 100644 --- a/app/src/Service/Venta/MediosPago/Toku/Subscription.php +++ b/app/src/Service/Venta/MediosPago/Toku/Subscription.php @@ -1,6 +1,7 @@ delete($tokuId); $this->subscriptionRepsitory->removeByTokuId($tokuId); - } catch (EmptyResponse $exception) { + } catch (EmptyResponse | PDOException $exception) { $this->logger->warning($exception, ['subscription->toku_id' => $tokuId]); } }