• 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 web3 ERC20 token function call

Call to a member function fetch_field() on a non-object MySQLiDB

Call authenticate manually in router middleware

Submitting a form with ajax in Wordpress

Target Laravelista is not instantiable

Problem with fetching data from database in Laravel

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

Laravel 5 session not persisting after user is logged in

Laravel Jetsream Profile page not loading on fresh install

Filter WooCommerce products with post__in and additional meta queries

How to submit the custom form data in database in WordPress without plugin using ajax?

XML to CSV with PHP converter [problem with images grabing]

How to create custom authentication in laravel 8?

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

Laravel display validation error

About Contact Privacy policy Terms and conditions