• 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

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'posts.post' doesn't exist

Unable to guess the mime type as no guessers are available Laravel 5.2

PHP Slim Framework request using withAttribute error

Unable to create lockable file - Laravel 8 & PHP 8

Can't find vendor/autoload.php for Ratchet

Having trouble with PDO queries (Notice: Undefined index)

Cache clear probem in Larave

Alert message after submitting form in PHP

Doctrine ORM: Excluding Records Based on Values of Nested Relationships

Losing session data after POST from third party website

How to display table header in every page using FPDF library?

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

How to edit Records using CodeIgniter

Adding hreflang tags automatically in WordPress subdirectory multisite

Laravel multi auth - Authentication user provider [] is not defined

About Contact Privacy policy Terms and conditions