• 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

Xdebug can't connect back to Docker host

Laravel Unknown Column 'updated_at'

CodeIgniter force_download is not working

PHP: How to raise number to (tiny) fractional exponent?

Testing subscription renewals on Stripe

how to check version of codeigniter framework?

PHP: PDO + CSV export not downloading (headers issue?)

Add rows to Single product Additional information table in WooCommerce 3.6

I need to link Google Sheet with my Laravel

Using array_intersect on a multi-dimensional array

Check if string contains a value in array [duplicate]

How to render html from a @foreach loop in a textarea

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

PHPExcel export HTML table to xlsx

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

About Contact Privacy policy Terms and conditions