• 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

Destroy session upon refresh

auth pages not getting css in laravel

PHP how to detect if running on arm64 cpu?

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

Multiple order by in WooCommerce

How to give apache permission to write to home directory?

Get WooCommerce product variation attribute terms in admin products general box

Composer fails with kylekatarnls/update-helper on new homestead

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

How to convert time from one timezone to another in PHP

Adding reCAPTCHA v2 into my PHP file

How to install LDAP in Docker php-fpm alpine

How to create a video stream from a single dynamic image in PHP

Artisan, creating tables in database

Laravel no logout option from menu after successfull login

About Contact Privacy policy Terms and conditions