• 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

Issue with laravel eloquent model property

Creating Combinations of Elements

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

Can we define variables in `.tpl` files?

Minimum order amount except for specific shipping method in WooCommerce

Laravel implode array items to new lines

Display a product custom field only in WooCommerce Admin single orders

How to make a foreign key not using primary key

Is it possible to change the table name in the migration file-laravel

WAMP Virtual Host not working

How to insert Google Adsense Code in PHP script?

find in set in laravel ? example

Display the default discounted price and percentage on Woocommerce products

Laravel update hasMany relationship using saveMany

About Contact Privacy policy Terms and conditions