• 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

Composer Script echo

jQuery Ajax Post with data

Render the content of default_filter.php in Joomla front-end

PHP SoapClient: set a namespace without prefix

Check if user online laravel

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

PHP using str_starts_with for array to exclude same as with wildcard

Using spatie/media-library, how to rename a collection of uploaded files?

Component install error: JInstaller: :Install: File does not exist

How should I get started using PHPUnit as a testing framework for a bunch of functions and classes I have already made?

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

Google Calendar API batch request PHP

How do I Post to .txt document before form submits

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

How to set dynamic `home` and `siteurl` in WordPress?

About Contact Privacy policy Terms and conditions