• 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 pass security cloudflare server with php curl

500 Internal Server Error on Ajax request. Not sure the origin of the problem

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

Filter WooCommerce products with post__in and additional meta queries

SQL to convert multiple rows into a single row of variable length

Combine array with same value and add other [duplicate]

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

"There is no active transaction" when refreshing database in Laravel 8.0 test

Yii2: How do I debug console commands?

Laravel 8 factory state afterCreating

Why i get wrong output for html markdown?

Manage independently the decimal number of the price of each product [duplicate]

PHP: Telegram Bot: Insert line break to text message

How to extract price from given url using Xpath?

How to connect to MSSQL Server with PHP from Ubuntu 18.04?

About Contact Privacy policy Terms and conditions