• 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

Woocommerce Edit Message "An account is already registered with your email address. Please log in."

Laravel Carbon get start + end of last week?

Convert PHP array into HTML tag attributes separated by spaces

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

laravel automatically deletes server.php on php artisan serve

Return multiple values from a function using mysqli_fetch_assoc [closed]

Shopify password update using Shopify API

How to skip cart page on woocomerce for certain products only?

How to validate Envato Purchase Code in PHP

Creating command to backup MySql database in Laravel

Log file is not being written in Laravel 5.5

how to fix Service provider class not found when using repository?

ConstraintViolationListInterface to Exception in Symfony

api response laravel doesn't show

LARAVEL: How to fetch id dynamically in a query builder?

About Contact Privacy policy Terms and conditions