• 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

Laravel - How to properly generate unique slugs from article titles?

ORA-12546: TNS:permission denied error connection to remote oracle server

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

Respond with status code 401 on authentication failure using Laravel and Passport?

PHP mail sending empty mails

LARAVEL: How to fetch id dynamically in a query builder?

Php - Sum up the numbers in an array one by one

mysql slow on updates for a well optimized query

Add bold text and line break into Laravel Notification Email

Symfony autowiring issues since docker update

php script to delete files older than 24 hrs, deletes all files

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

How to make a foreign key not using primary key

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

About Contact Privacy policy Terms and conditions