• 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

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

CodeIgniter 4: Like and Dislike Functionality

php echo remove slashes from url [duplicate]

PHP: convert all UTF-8 characters to HTML entities

Facebook PHP SDK - will not logout properly

Download & Save Zoom Recording in directory by PHP

Method IlluminateAuthRequestGuard::logout does not exist Laravel Passport

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

Doctrine 2 mapping referencing unique key

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

php file upload scanning using clamav, permissions on /tmp/

Laravel whole batch is cancelled if one Job fails

Make Shipping Method fields Mandatory on Woocommerce checkout page

What is the function of the (new Date()).getTime() in PHP?

send email using gmail-api and google-api-php-client

About Contact Privacy policy Terms and conditions