• 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

PHP array stringify

How to get quarter for future date using Carbon?

Laravel after login Two factor not working

Wordpress 'post_type_link' hides permalink

Twig - How to check if variable is a number / integer

phpunit - mockbuilder - set mock object internal property

Transpose and flatten multiple rows of array data [duplicate]

XDebug not working in VScode for php debugging

How to delete old images from public folder on update using Laravel

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

Fatal error: [] operator not supported for strings

Store / Website Column in Magento 2 Admin Grid - Custom Module

Valet, Xdebug after reboot Big Sur not working

Laravel: Why is my variable not being set while it's in the construct function of the controller?

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

About Contact Privacy policy Terms and conditions