From 0a773101d2a8137b232f3232d385e94176d458f7 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 19 Feb 2025 14:51:13 -0500 Subject: [PATCH] Reordered the logger statement in the case where the rest of the execution fails for whatever reason --- src/Socialbox/Socialbox.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Socialbox/Socialbox.php b/src/Socialbox/Socialbox.php index 2ab0ada..77a9a1a 100644 --- a/src/Socialbox/Socialbox.php +++ b/src/Socialbox/Socialbox.php @@ -676,6 +676,11 @@ */ private static function returnError(int $responseCode, StandardError $standardError, ?string $message=null, ?Throwable $e=null): void { + if($e !== null) + { + Logger::getLogger()->error($message, $e); + } + if($message === null) { $message = $standardError->getMessage(); @@ -690,11 +695,6 @@ { print(PHP_EOL . PHP_EOL . Utilities::throwableToString($e)); } - - if($e !== null) - { - Logger::getLogger()->error($message, $e); - } } /**