Skip to content

[READONLY] Package that facilitates sentry integration with context scoped exceptions that are able to transport data when an exception happened.

License

Notifications You must be signed in to change notification settings

abenevaut/laravel-sentry-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

composer require abenevaut/laravel-sentry-handler
php artisan sentry:publish --dsn=

Two ways to customize your handler

Inheritance from abenevaut\SentryHandler\Handler

In app/Exceptions/Handler.php Replace use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; by use abenevaut\SentryHandler\Handler as ExceptionHandler;

Note: that method is used in demo

Use the trait abenevaut\SentryHandler\Traits\SentryHandlerTrait

In app/Exceptions/Handler.php Add use SentryHandlerTrait; in App\Exceptions\Handler class Then adjust your report() method

public function report(\Throwable $e): void
{
    // Report standard exceptions to sentry
    $this->reportSentry($e);

    parent::report($e);
}

Test

php artisan sentry:test

About

[READONLY] Package that facilitates sentry integration with context scoped exceptions that are able to transport data when an exception happened.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages