Merge pull request #4486 from turbo124/v5-develop

Filter exceptions
This commit is contained in:
David Bomba 2020-12-12 22:23:57 +11:00 committed by GitHub
commit 5a9d0757cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'));
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.
*