mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Some clean up in the error handler.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
namespace FireflyIII\Exceptions;
|
namespace FireflyIII\Exceptions;
|
||||||
|
|
||||||
|
use Auth;
|
||||||
use ErrorException;
|
use ErrorException;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Auth\Access\AuthorizationException;
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
@@ -13,7 +14,7 @@ use Mail;
|
|||||||
use Request;
|
use Request;
|
||||||
use Swift_TransportException;
|
use Swift_TransportException;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
use Auth;
|
|
||||||
/**
|
/**
|
||||||
* Class Handler
|
* Class Handler
|
||||||
*
|
*
|
||||||
@@ -68,14 +69,11 @@ class Handler extends ExceptionHandler
|
|||||||
|
|
||||||
if ($exception instanceof FireflyException || $exception instanceof ErrorException) {
|
if ($exception instanceof FireflyException || $exception instanceof ErrorException) {
|
||||||
|
|
||||||
// log
|
|
||||||
Log::error($exception->getMessage());
|
|
||||||
|
|
||||||
// mail?
|
// mail?
|
||||||
try {
|
try {
|
||||||
$email = env('SITE_OWNER');
|
$email = env('SITE_OWNER');
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
$args = [
|
$args = [
|
||||||
'errorMessage' => $exception->getMessage(),
|
'errorMessage' => $exception->getMessage(),
|
||||||
'stacktrace' => $exception->getTraceAsString(),
|
'stacktrace' => $exception->getTraceAsString(),
|
||||||
'file' => $exception->getFile(),
|
'file' => $exception->getFile(),
|
||||||
@@ -99,7 +97,6 @@ class Handler extends ExceptionHandler
|
|||||||
// could also not mail! :o
|
// could also not mail! :o
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::report($exception);
|
parent::report($exception);
|
||||||
|
Reference in New Issue
Block a user