• 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

jQuery Ajax Post with data

PHP file_get_contents function

How to create a video stream from a single dynamic image in PHP

PHP random string generator

How to make autocomplete work in foreach php loop? (vscode, intellisense)

enroll_table three field fetch to payment form to create payment field in laravel 5.5

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

Connecting an HTML webpage to a SQL Server

Yii2 select2 database exception number of bound variables does not match number of tokens

SlimExceptionHttpNotFoundException

Check if user online laravel

getting error while enter Command => php artisan route:list

best way to store error messages in Laravel (session or variable)

Add bold text and line break into Laravel Notification Email

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

About Contact Privacy policy Terms and conditions