• 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

Combine multiple columns into an array as one of the key in a results set

enable Apache http Authorization header

Add 2 Webcam in one page with WebcamJS

Add New Parameter to Existing URL using htaccess

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Comma separated list from array with "and" before last element

How to display MySQL table using php and edit it in a web browser

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

Laravel dosen't connect with Oracle

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

How to execute sql code based on fetch array

Laravel s3 upload file with metadata using pre-signed url

How to install PHP composer inside a docker container

Losing session data after POST from third party website

How to render html from a @foreach loop in a textarea

About Contact Privacy policy Terms and conditions