1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Update Sentry Laravel SDK

This commit is contained in:
Michael Hoffmann 2022-12-02 23:55:00 +01:00
parent 90754ec6be
commit 4651922be6
No known key found for this signature in database
GPG Key ID: B36728CE89B07444
4 changed files with 27 additions and 22 deletions

View File

@ -32,6 +32,7 @@ use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Schema;
use Illuminate\Validation\ValidationException;
use PDOException;
use Sentry\Laravel\Integration;
use Sentry\State\Scope;
use Swift_TransportException;
use Symfony\Component\Console\Exception\CommandNotFoundException;
@ -84,7 +85,7 @@ class Handler extends ExceptionHandler
}
if (Ninja::isHosted() && ! ($exception instanceof ValidationException)) {
app('sentry')->configureScope(function (Scope $scope): void {
Integration::configureScope(function (Scope $scope): void {
$name = 'hosted@invoiceninja.com';
if (auth()->guard('contact') && auth()->guard('contact')->user()) {
@ -104,9 +105,9 @@ class Handler extends ExceptionHandler
]);
});
app('sentry')->captureException($exception);
Integration::captureUnhandledException($exception);
} elseif (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->configureScope(function (Scope $scope): void {
Integration::configureScope(function (Scope $scope): void {
if (auth()->guard('contact') && auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) {
$scope->setUser([
'id' => auth()->guard('contact')->user()->company->account->key,
@ -123,7 +124,7 @@ class Handler extends ExceptionHandler
});
if ($this->validException($exception)) {
app('sentry')->captureException($exception);
Integration::captureUnhandledException($exception);
}
}

View File

@ -76,7 +76,7 @@
"pragmarx/google2fa": "^8.0",
"turbo124/predis": "^1.1",
"razorpay/razorpay": "2.*",
"sentry/sentry-laravel": "^2",
"sentry/sentry-laravel": "^3",
"setasign/fpdf": "^1.8",
"setasign/fpdi": "^2.3",
"socialiteproviders/apple": "^5.2",

33
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "a27743d9d10e85380cec2a67aeb6d77c",
"content-hash": "451d3dbdd5b0a87940e0f8fffadab4ae",
"packages": [
{
"name": "afosto/yaac",
@ -8121,37 +8121,42 @@
},
{
"name": "sentry/sentry-laravel",
"version": "2.14.2",
"version": "3.1.1",
"source": {
"type": "git",
"url": "https://github.com/getsentry/sentry-laravel.git",
"reference": "4538ed31d77868dd3b6d72ad6e5e68b572beeb9f"
"reference": "dd55f62a5b7bed0edabc5afcd04e5435713f57ae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/4538ed31d77868dd3b6d72ad6e5e68b572beeb9f",
"reference": "4538ed31d77868dd3b6d72ad6e5e68b572beeb9f",
"url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/dd55f62a5b7bed0edabc5afcd04e5435713f57ae",
"reference": "dd55f62a5b7bed0edabc5afcd04e5435713f57ae",
"shasum": ""
},
"require": {
"illuminate/support": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
"illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0",
"nyholm/psr7": "^1.0",
"php": "^7.2 | ^8.0",
"sentry/sdk": "^3.1",
"sentry/sentry": "^3.3",
"sentry/sdk": "^3.3",
"sentry/sentry": "^3.10",
"symfony/psr-http-message-bridge": "^1.0 | ^2.0"
},
"conflict": {
"laravel/lumen-framework": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.11",
"laravel/framework": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
"laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0",
"mockery/mockery": "^1.3",
"orchestra/testbench": "3.1 - 3.8 | ^4.7 | ^5.1 | ^6.0 | ^7.0",
"phpunit/phpunit": "^5.7 | ^6.5 | ^7.5 | ^8.4 | ^9.3"
"orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0",
"phpunit/phpunit": "^8.4 | ^9.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev",
"dev-master": "3.x-dev",
"dev-2.x": "2.x-dev",
"dev-1.x": "1.x-dev",
"dev-0.x": "0.x-dev"
},
"laravel": {
@ -8193,7 +8198,7 @@
],
"support": {
"issues": "https://github.com/getsentry/sentry-laravel/issues",
"source": "https://github.com/getsentry/sentry-laravel/tree/2.14.2"
"source": "https://github.com/getsentry/sentry-laravel/tree/3.1.1"
},
"funding": [
{
@ -8205,7 +8210,7 @@
"type": "custom"
}
],
"time": "2022-10-13T09:21:29+00:00"
"time": "2022-11-14T11:55:52+00:00"
},
{
"name": "setasign/fpdf",

View File

@ -4,8 +4,8 @@ return [
//'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),
'dsn' => config('ninja.sentry_dsn'),
// capture release as git sha
// 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')),
'release' => config('ninja.app_version'),
'breadcrumbs' => [
// Capture Laravel logs in breadcrumbs
@ -26,5 +26,4 @@ return [
// @see: https://docs.sentry.io/error-reporting/configuration/?platform=php#send-default-pii
'send_default_pii' => false,
'release' => config('ninja.app_version'),
];