• 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

how to loop through json response data using ajax jquery?

How to use PHPCBF to fix one issue at a time?

laravel MVC execution flow

Class AppHttpControllersUserController Does Not Exist

IlluminateDatabaseQueryException could not find driver [duplicate]

Search for array row with specific column value and return another value from qualifying row

PHP drop down list using array's and foreach (else and for) code

PHP Print to Network Printer

I cannot create a auto generated date time in mysql workbench

How to get monthly wise data in laravel

Laravel passport auth token not working after moving to different server

How to solve Duplicate entry '0' for key 'PRIMARY' in Wordpress?

Pass an image through AJAX [duplicate]

Sum array values

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

About Contact Privacy policy Terms and conditions