• 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

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

Zig-zag scan an N x N array

ldap is missing from system when installing adldap2 in laravel

Check for PDO Results, If None Display Message, If Yes then Loop Through

Sort a multidimensional array by integer inside of a string value which is two levels down

PHP - installing Xdebug on Mac with XAMPP (Unix File)

echo language construct is discouraged. (PHP)

PHP: How to solve ob_start() in combination imagepng() issue?

PhP how to calculate moments with variables rows

PHP how to detect if running on arm64 cpu?

Check if my GET request has Header: Token

How to give apache permission to write to home directory?

Target Laravelista is not instantiable

Trying to iterate over a mongodb cursor twice - failing

How update php.ini on a Mac OS X Mojave?

About Contact Privacy policy Terms and conditions