Fixed: mail sending

- If sending mail fails, should handle case laravel 7
- should catch \Error instead of \ErrorException
This commit is contained in:
Jérémy Munsch 2022-02-03 16:22:24 +01:00
parent 5129f466bc
commit 35ef47aaea
No known key found for this signature in database
GPG key ID: 55196BEE445F6049

View file

@ -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]);
}
};