• 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

Adding multiple items to WooCommerce cart at once

Override default Auth routes in Laravel 7

IlluminateDatabaseQueryException: SQLSTATE[HY000]: General error: 1 no such table - In clone project

How to test laravel controller method?

Elastic Beanstalk with Laravel Envoy

how to retrieve the first and last instance of a row in pdo dataset

PHP: Telegram Bot: Insert line break to text message

Smarty if isset

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

Nginx disallowing execution of PHP in uploads directory with Magento

How to display MySQL table using php and edit it in a web browser

"cannot list resources" error from WooCommerce REST API

Redis Command To Sort Keys

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

How to change the app environment at run time?

About Contact Privacy policy Terms and conditions