• 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 display MySQL table using php and edit it in a web browser

I want to display a sweetalert after the inserting of data in my database

Laravel MSSQL Server Connection not working

Custom add to cart button URL for specific product in WooCommerce?

Attempt to read property "view" on null when sending password reset email

How to access a var with "-" in PHP [duplicate]

Class AppHttpControllersUserController Does Not Exist

How to submit the custom form data in database in WordPress without plugin using ajax?

Fetch files from next cloud storage and display in Laravel website

Put content of wordpress page inside div

PHP Imap , php 7.4.3 on mac osx catalina

PHP Include for HTML?

Trying to mock an http client that is inside a controller, using phpunit, but it doesn't work

Adding one microsecond to Datetime object in PHP

Issue saving card for customer

About Contact Privacy policy Terms and conditions