• 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

could not find driver Debian SQL Server PHP

PHP Include for HTML?

Laravel Model save() & update() Not Saving

mysql_result is defined but mysql_free_result warns it expected a resource

how to pass row id in href of a tag in codeigniter controller?

How do I upload a laravel project on cPanel shared hosting?

How to fix bootstrap multiselect search data using ajax

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

How to test a php login connected to a mysql db through xampp?

How to get AJAX to post on second page?

Extract house numbers from address string

How to remove from a multidimensional array all duplicate elements including the original?

Laravel - How to properly generate unique slugs from article titles?

get data-value with variable value

Check if a string contain multiple specific words

About Contact Privacy policy Terms and conditions