• 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 modify CSS in a specific page of the WP admin dashboard (backend)

Laravel 5 issue with wherePivot

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

MySQL default time format UTC or GMT?

PHP my timezone is no setting up in PHP.ini File in xampp

Mobile browsers are adding .html to filename on download

Losing session data after POST from third party website

Sort a multidimensional array by integer inside of a string value which is two levels down

How to change 'users' auth table and use another instead Laravel

How to increase the PHP upload limits [duplicate]

Unable to Edit config.inc.php

Laravel Factory not calling callback 'afterCreating'

Method IlluminateAuthRequestGuard::logout does not exist Laravel Passport

calling server using nusoap with complextype

Convert regular text to array using notepad++

About Contact Privacy policy Terms and conditions