From 35ef47aaeaaf7b968c20f623735a4031dc2af97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Thu, 3 Feb 2022 16:22:24 +0100 Subject: [PATCH] Fixed: mail sending - If sending mail fails, should handle case laravel 7 - should catch \Error instead of \ErrorException --- src/Exceptions/ExceptionHandler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Exceptions/ExceptionHandler.php b/src/Exceptions/ExceptionHandler.php index 9982158..fe9f4fa 100644 --- a/src/Exceptions/ExceptionHandler.php +++ b/src/Exceptions/ExceptionHandler.php @@ -40,8 +40,9 @@ class ExceptionHandler extends Handler if (get_class($e) == RedirectTo::class) { abort(redirect($e->url)); } + // ? If in laravel 7 and and error occurs when sending mail. if ( - \strpos(app()->version(), '8') !== 0 and + \strpos(app()->version(), '7') === 0 and !$this->reportExceptionByEmail()($e) ) { return false; @@ -95,8 +96,7 @@ class ExceptionHandler extends Handler } }); } - } catch (\ErrorException $e) { - dd($e); + } catch (\Error $e) { Log::critical('Handler could not send Exception email', ['exception' => $e]); } };