Changes in error handler

This commit is contained in:
James Cole
2018-05-29 07:09:11 +02:00
parent 0a007b1e6e
commit 5b4967acb9

View File

@@ -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:
$doMailError === true &&
((
// and if is one of these error instances
$exception instanceof FireflyException $exception instanceof FireflyException
|| $exception instanceof ErrorException || $exception instanceof ErrorException
|| $exception instanceof OAuthServerException || $exception instanceof OAuthServerException
|| $exception instanceof AuthenticationException
)
&& $doMailError) {
)
|| (
// 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',