From cef09c752203a61642ac3fc42ddf6256f91eaf72 Mon Sep 17 00:00:00 2001 From: Nasrin Afroz Kakoli Date: Wed, 29 May 2024 15:25:55 +0600 Subject: [PATCH] Handle Notification failure in CleanupJob.php as BackupJob.php --- src/Tasks/Cleanup/CleanupJob.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Tasks/Cleanup/CleanupJob.php b/src/Tasks/Cleanup/CleanupJob.php index e29a15fb..d327cda5 100644 --- a/src/Tasks/Cleanup/CleanupJob.php +++ b/src/Tasks/Cleanup/CleanupJob.php @@ -60,7 +60,10 @@ public function run(): void protected function sendNotification($notification): void { if ($this->sendNotifications) { - event($notification); + rescue( + fn () => event($notification), + fn () => consoleOutput()->error('Sending notification failed') + ); } } }