mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-27 05:51:56 +00:00
Changes in error handler
This commit is contained in:
@@ -131,14 +131,22 @@ class Handler extends ExceptionHandler
|
|||||||
|
|
||||||
$doMailError = env('SEND_ERROR_MESSAGE', true);
|
$doMailError = env('SEND_ERROR_MESSAGE', true);
|
||||||
if (
|
if (
|
||||||
(
|
// if the user wants us to mail:
|
||||||
$exception instanceof FireflyException
|
$doMailError === true &&
|
||||||
|| $exception instanceof ErrorException
|
((
|
||||||
|| $exception instanceof OAuthServerException
|
// and if is one of these error instances
|
||||||
|| $exception instanceof AuthenticationException
|
$exception instanceof FireflyException
|
||||||
)
|
|| $exception instanceof ErrorException
|
||||||
&& $doMailError) {
|
|| $exception instanceof OAuthServerException
|
||||||
|
|
||||||
|
)
|
||||||
|
|| (
|
||||||
|
// or this one, but it's a JSON exception.
|
||||||
|
$exception instanceof AuthenticationException
|
||||||
|
&& Request::acceptsJson() === true
|
||||||
|
))
|
||||||
|
) {
|
||||||
|
// then, send email
|
||||||
$userData = [
|
$userData = [
|
||||||
'id' => 0,
|
'id' => 0,
|
||||||
'email' => 'unknown@example.com',
|
'email' => 'unknown@example.com',
|
||||||
@@ -157,7 +165,7 @@ class Handler extends ExceptionHandler
|
|||||||
'code' => $exception->getCode(),
|
'code' => $exception->getCode(),
|
||||||
'version' => config('firefly.version'),
|
'version' => config('firefly.version'),
|
||||||
'url' => Request::fullUrl(),
|
'url' => Request::fullUrl(),
|
||||||
'userAgent' => Request::userAgent(),
|
'userAgent' => Request::userAgent(),
|
||||||
'json' => Request::acceptsJson(),
|
'json' => Request::acceptsJson(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user