• 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, move keys and values to new array, but mix it up

Using spatie/media-library, how to rename a collection of uploaded files?

How to add a custom field to all Woocommerce attribute terms using add_action

Why rand() every time I refresh the page?

Call authenticate manually in router middleware

Wordpress 'post_type_link' hides permalink

Add a text next to stock quantity if it is less than 10 in Woocommerce single product

Prestashop cUrl Login

Encrypt in php and decrypt in Dart(flutter)

How avoid Moved Permanently The document has moved here

file_put_content...fail to open stream:Permission denied in Laravel 5

Create a zip file and download it

How to create custom authentication in laravel 8?

how to youtube api data to print in toolset metabox using a button click before save-post

Symfony Make:Migration : The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue

About Contact Privacy policy Terms and conditions