Skip to content

Commit

Permalink
#308 - introducing Sentry (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofrewak authored May 30, 2023
1 parent fa05fd5 commit 7c9328c
Show file tree
Hide file tree
Showing 4 changed files with 1,503 additions and 301 deletions.
10 changes: 10 additions & 0 deletions app/Architecture/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Illuminate\Foundation\Exceptions\Handler;
use Inertia\Inertia;
use Sentry\State\HubInterface;
use Symfony\Component\HttpFoundation\Response;
use Throwable;

Expand All @@ -26,6 +27,15 @@ class ExceptionHandler extends Handler
Response::HTTP_UNAUTHORIZED,
];

public function register(): void
{
$this->reportable(function (Throwable $exception): void {
if (app()->bound(HubInterface::class)) {
app(HubInterface::class)->captureException($exception);
}
});
}

public function render($request, Throwable $e): Response
{
$response = parent::render($request, $e);
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
"maatwebsite/excel": "^3.1",
"phpoffice/phpword": "^1.0.0",
"rackbeat/laravel-ui-avatars": "^1.2",
"sentry/sentry-laravel": "^3.4",
"spatie/laravel-google-calendar": "^3.5",
"spatie/laravel-model-states": "^2.1",
"spatie/laravel-slack-slash-command": "^1.11"
},
"require-dev": {
"blumilksoftware/codestyle": "^2.0",
"blumilksoftware/codestyle": "^2.2",
"fakerphp/faker": "^1.19",
"laravel/dusk": "^7.1",
"mockery/mockery": "^1.5",
Expand Down Expand Up @@ -71,7 +72,10 @@
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"php-http/discovery": false
}
},
"minimum-stability": "stable",
"prefer-stable": true
Expand Down
Loading

0 comments on commit 7c9328c

Please sign in to comment.