mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 15:44:37 -04:00
Fixes for exceptions
This commit is contained in:
parent
0a5b4fe7e2
commit
1cc3eed322
@ -14,6 +14,7 @@ namespace App\Exceptions;
|
|||||||
use App\Exceptions\FilePermissionsFailure;
|
use App\Exceptions\FilePermissionsFailure;
|
||||||
use App\Exceptions\InternalPDFFailure;
|
use App\Exceptions\InternalPDFFailure;
|
||||||
use App\Exceptions\PhantomPDFFailure;
|
use App\Exceptions\PhantomPDFFailure;
|
||||||
|
use App\Utils\Ninja;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Auth\Access\AuthorizationException;
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
@ -75,7 +76,26 @@ class Handler extends ExceptionHandler
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app()->bound('sentry') && $this->shouldReport($exception)) {
|
if(Ninja::isHosted()){
|
||||||
|
|
||||||
|
app('sentry')->configureScope(function (Scope $scope): void {
|
||||||
|
|
||||||
|
if(auth()->guard('contact') && auth()->guard('contact')->user())
|
||||||
|
$key = auth()->guard('contact')->user()->company->account->key;
|
||||||
|
elseif (auth()->guard('user') && auth()->guard('user')->user())
|
||||||
|
$key = auth()->user()->account->key;
|
||||||
|
else
|
||||||
|
$key = 'Anonymous';
|
||||||
|
|
||||||
|
$scope->setUser([
|
||||||
|
'id' => 'Hosted_User',
|
||||||
|
'email' => 'hosted@invoiceninja.com',
|
||||||
|
'name' => $key,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif (app()->bound('sentry') && $this->shouldReport($exception)) {
|
||||||
app('sentry')->configureScope(function (Scope $scope): void {
|
app('sentry')->configureScope(function (Scope $scope): void {
|
||||||
if (auth()->guard('contact') && auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) {
|
if (auth()->guard('contact') && auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) {
|
||||||
$scope->setUser([
|
$scope->setUser([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user