From 9ef598d07bdaf6565ec79cf7078697e1634e56be Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 10 Oct 2023 15:16:12 -0700 Subject: [PATCH] Apply changes to exception handling for check outs to check ins --- app/Listeners/CheckoutableListener.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 01e5041f67..34d93550ed 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -98,11 +98,6 @@ class CheckoutableListener } try { - if ($this->shouldSendWebhookNotification()) { - Notification::route('slack', Setting::getSettings()->webhook_endpoint) - ->notify($this->getCheckinNotification($event)); - } - // Use default locale if (! $event->checkedOutTo->locale) { Notification::locale(Setting::getSettings()->locale)->send( @@ -115,7 +110,17 @@ class CheckoutableListener $this->getCheckinNotification($event) ); } + + if ($this->shouldSendWebhookNotification()) { + Notification::route('slack', Setting::getSettings()->webhook_endpoint) + ->notify($this->getCheckinNotification($event)); + } } catch (Exception $e) { + if ($e instanceof ClientException){ + Log::debug("Exception caught during checkout notification: ".$e->getMessage()); + return; + } + Log::error("Exception caught during checkin notification: ".$e->getMessage()); } }