• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Sentry + Laravel: how to log an already catched Exception?

phplaravelsentry


PHP Snippet 1:

try {
    // your code that could throw an exception
} catch (\Throwable $e) {
    if (app()->bound('sentry')) {
        app('sentry')->captureException($e);
    }
}

PHP Snippet 2:

try {
    // your code that could throw an exception
} catch (\Throwable $e) {
    report($e); // this is a Laravel helper, not from Sentry
}

PHP Snippet 3:

\Sentry\captureMessage("This handle a text message");

// this handle everything derives from \Exception
\Sentry\captureException($e);

Related Snippets

How to create laravel storage symbolic link for production or sub domain system?

WHM Enabling mod_rewrite

PHP using str_starts_with for array to exclude same as with wildcard

How to install PHP composer inside a docker container

Transpose and flatten multiple rows of array data [duplicate]

oauth-private.key does not exist or is not readable

Doctrine 2 mapping referencing unique key

Composer Script echo

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

Yii Ajax Submit button

PHP, how to convert Int value to Week days

Passing a boolean value from checkbox in Laravel form

Laravel Blade checkbox not checked

Using spatie/media-library, how to rename a collection of uploaded files?

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

About Contact Privacy policy Terms and conditions