• 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 excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

Laravel database insert with combining array and string

Filter WooCommerce products with post__in and additional meta queries

WordPress Subquery returns more than 1 row on SELECT

Laravel Jetsream Profile page not loading on fresh install

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

Display Link Title Instead of URL in XSL

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

In PHP, which is faster: preg_split or explode?

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

How to get Laravel's CSRF Token from Another Website?

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

I need to link Google Sheet with my Laravel

Creating live search with AJAX and CodeIgniter

PHP, how to convert Int value to Week days

About Contact Privacy policy Terms and conditions