• 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 get unique slug to same post-title for other time too?

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

enable Apache http Authorization header

Read users and passwords from a txt file

How to access a var with "-" in PHP [duplicate]

PHP array slice from position + attempt to return fixed number of items

Issue with laravel eloquent model property

Adding custom body class to the custom archive pages

SQL to convert multiple rows into a single row of variable length

Laravel Jetsream Profile page not loading on fresh install

Wordpress wpdb->delete issue

Select option from dropdown menu with PHP and mySql

how to display a view on laravel 8 and not have a 404 NOT FOUND page?

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

Laravel relationship belongsToMany with composite primary keys

About Contact Privacy policy Terms and conditions