From 477ba15c0f8e81b89836883d7cef2d8952f8db66 Mon Sep 17 00:00:00 2001 From: javier-villatoro Date: Mon, 5 Aug 2024 19:04:01 -0600 Subject: [PATCH] Remove unnecessary if --- src/Http/Client/LeverClient.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Http/Client/LeverClient.php b/src/Http/Client/LeverClient.php index e1584be..b554d98 100644 --- a/src/Http/Client/LeverClient.php +++ b/src/Http/Client/LeverClient.php @@ -480,18 +480,14 @@ private function handleException(Exception $e, string $method, string $endpoint, 'response' => null, ]; - if (! empty($options)) { - $logDetails['options'] = json_encode($options); - } - if ($e instanceof ClientException) { $logDetails['response'] = $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null; } - Log::error("HTTP Error in $method: ".$e->getMessage(), $logDetails); + Log::error("HTTP $method error: ".$e->getMessage(), $logDetails); $type = $e instanceof ClientException ? 'ClientException' : 'Exception'; - throw new LeverClientException("$type error executing HTTP request in $method. Please check the logs for more details."); + throw new LeverClientException("$type error executing HTTP $method. Please check the logs for more details."); } }