mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Filter exceptions
This commit is contained in:
parent
b8c1c130c9
commit
419b381c21
@ -72,10 +72,6 @@ class Handler extends ExceptionHandler
|
||||
info('account table not found');
|
||||
return;
|
||||
}
|
||||
// if(Account::count() == 0){
|
||||
// info("handler - account table not found");
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (app()->bound('sentry') && $this->shouldReport($exception)) {
|
||||
app('sentry')->configureScope(function (Scope $scope): void {
|
||||
@ -95,12 +91,28 @@ class Handler extends ExceptionHandler
|
||||
});
|
||||
|
||||
// app('sentry')->setRelease(config('ninja.app_version'));
|
||||
app('sentry')->captureException($exception);
|
||||
|
||||
if($this->validException($exception))
|
||||
app('sentry')->captureException($exception);
|
||||
}
|
||||
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
private function validException($exception)
|
||||
{
|
||||
info("the exception is ");
|
||||
info($exception->getMessage());
|
||||
|
||||
if(strpos($exception->getMessage(), 'file_put_contents') === TRUE)
|
||||
return FALSE;
|
||||
|
||||
if(strpos($exception->getMessage(), 'Permission denied') === TRUE)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user