• 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 Command Schedule Not Working Properly

How to make dot match newline characters using regular expressions

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

How to change HTML structure inside WP <head>

Display a product custom field only in WooCommerce Admin single orders

Reorder attribute dropdown terms in Woocommerce single variable products

How can I get new CSRF token in LARAVEL by using ajax

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Limit login attempts in Laravel 5.7

OctoberCMS / Anonymous Global Scope

How can I pass the list to the component variable in Laravel?

Using PHP to connect to a remote MSSQL database

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

Unit (real unit test) of test laravel relationship

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

About Contact Privacy policy Terms and conditions