• 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 redirect the user back to desired URL after login page in PHP?

Trying to iterate over a mongodb cursor twice - failing

Laravel Get Days In Month From Month Number?

Increase value by 1 on button click

Make certain characters of a word from string bold

Laravel Mix Uncaught ReferenceError: $ is not defined

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

Laravel 5 issue with wherePivot

Laravel Excel::store file empty after stored

Querying only one row from a one to many relationship laravel

Laravel after login Two factor not working

Woocommerce product attributes with hierarchy like categories

php curl_exec() Connection refused when retrieving a remote image

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

Unit (real unit test) of test laravel relationship

About Contact Privacy policy Terms and conditions