From 4846d50148ac575e572fd2e5f5a297a881a79edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 11 Apr 2025 08:45:18 +0200 Subject: [PATCH] fix: correctly instantiate exception and log error --- src/BusProNet/ApiClient.php | 4 +++- src/BusProNet/Exception/ApiClientException.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/BusProNet/ApiClient.php b/src/BusProNet/ApiClient.php index 89763bc..606ac42 100644 --- a/src/BusProNet/ApiClient.php +++ b/src/BusProNet/ApiClient.php @@ -323,9 +323,11 @@ class ApiClient $this->dumpXmlToFile('response', $requestId, $xml); } - throw new ApiClientException('Unexpected response received from API', [ + $this->logger->error('Unexpected response received from API', [ 'request_id' => $requestId, ]); + + throw new ApiClientException('Unexpected response received from API'); } private function dumpXmlToFile(string $type, string $requestId, string $body): void diff --git a/src/BusProNet/Exception/ApiClientException.php b/src/BusProNet/Exception/ApiClientException.php index 9adb00c..6ce1337 100644 --- a/src/BusProNet/Exception/ApiClientException.php +++ b/src/BusProNet/Exception/ApiClientException.php @@ -4,4 +4,4 @@ namespace App\BusProNet\Exception; class ApiClientException extends \Exception { -} \ No newline at end of file +}