fix: correctly instantiate exception and log error

This commit is contained in:
Björn Fromme
2025-04-11 08:45:18 +02:00
parent af4ba42b56
commit 4846d50148
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -323,9 +323,11 @@ class ApiClient
$this->dumpXmlToFile('response', $requestId, $xml); $this->dumpXmlToFile('response', $requestId, $xml);
} }
throw new ApiClientException('Unexpected response received from API', [ $this->logger->error('Unexpected response received from API', [
'request_id' => $requestId, 'request_id' => $requestId,
]); ]);
throw new ApiClientException('Unexpected response received from API');
} }
private function dumpXmlToFile(string $type, string $requestId, string $body): void private function dumpXmlToFile(string $type, string $requestId, string $body): void
@@ -4,4 +4,4 @@ namespace App\BusProNet\Exception;
class ApiClientException extends \Exception class ApiClientException extends \Exception
{ {
} }