mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 04:34:00 +00:00
Make sure the email error mails everything.
This commit is contained in:
@@ -32,6 +32,7 @@ use FireflyIII\Jobs\MailError;
|
|||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Validation\ValidationException as LaravelValidationException;
|
use Illuminate\Validation\ValidationException as LaravelValidationException;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use Log;
|
use Log;
|
||||||
@@ -131,9 +132,10 @@ class Handler extends ExceptionHandler
|
|||||||
public function report(Throwable $e)
|
public function report(Throwable $e)
|
||||||
{
|
{
|
||||||
$doMailError = config('firefly.send_error_message');
|
$doMailError = config('firefly.send_error_message');
|
||||||
if ($this->shouldntReport($e) || !$doMailError) {
|
if ($this->shouldntReportLocal($e) || !$doMailError) {
|
||||||
Log::info('Will not report on this error.');
|
Log::info('Will not report on this error.');
|
||||||
parent::report($e);
|
parent::report($e);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$userData = [
|
$userData = [
|
||||||
@@ -165,4 +167,20 @@ class Handler extends ExceptionHandler
|
|||||||
|
|
||||||
parent::report($e);
|
parent::report($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Throwable $e
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function shouldntReportLocal(Throwable $e): bool
|
||||||
|
{
|
||||||
|
return !is_null(
|
||||||
|
Arr::first(
|
||||||
|
$this->dontReport, function ($type) use ($e) {
|
||||||
|
return $e instanceof $type;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user