From 388148356b74baf10ad2fa24b206324432d3f6cc Mon Sep 17 00:00:00 2001 From: Matteo Gheza Date: Sun, 3 Sep 2023 22:03:26 +0200 Subject: [PATCH] Fix job failed error type --- backend/app/Jobs/NotifyUsersManualModeOn.php | 2 +- backend/app/Jobs/ResetAvailabilityMinutes.php | 2 +- backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app/Jobs/NotifyUsersManualModeOn.php b/backend/app/Jobs/NotifyUsersManualModeOn.php index ceec3f1..77c4c4c 100644 --- a/backend/app/Jobs/NotifyUsersManualModeOn.php +++ b/backend/app/Jobs/NotifyUsersManualModeOn.php @@ -54,7 +54,7 @@ class NotifyUsersManualModeOn implements ShouldQueue } } - public function failed(\Exception $exception) + public function failed(\Error|\TypeError $exception = null) { if (app()->bound('sentry')) { app('sentry')->captureException($exception); diff --git a/backend/app/Jobs/ResetAvailabilityMinutes.php b/backend/app/Jobs/ResetAvailabilityMinutes.php index 91ac612..8d360a5 100644 --- a/backend/app/Jobs/ResetAvailabilityMinutes.php +++ b/backend/app/Jobs/ResetAvailabilityMinutes.php @@ -50,7 +50,7 @@ class ResetAvailabilityMinutes implements ShouldQueue } } - public function failed(\Exception $exception) + public function failed(\Error|\TypeError $exception = null) { if (app()->bound('sentry')) { app('sentry')->captureException($exception); diff --git a/backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php b/backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php index e6ef30a..3343ee8 100644 --- a/backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php +++ b/backend/app/Jobs/UpdateAvailabilityWithSchedulesJob.php @@ -97,9 +97,9 @@ class UpdateAvailabilityWithSchedulesJob implements ShouldQueue } } - public function failed(\Exception $exception) + public function failed(\Error|\TypeError $exception = null) { - if (app()->bound('sentry')) { + if (app()->bound('sentry') && !is_null($exception)) { app('sentry')->captureException($exception); } }