• 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

Installing Composer - Internal Error

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

How can I easily switch between PHP versions on Mac OSX?

Dropzone: Submit both form data and dropzone at once

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

PHPS source file - 403 Forbidden You don't have permission to access this resource

Two buttons one form

Add Class in html Dynamically in PHP

Currently Using CodeIgniter Framework i have an Error

I can't delete my image when it is liked because of the foreign key in mysql

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

Substitute integers and dots with regex [duplicate]

Dropdown with current value from Mysql

Remove product downloads section in woocommerce email notifications

Redis Command To Sort Keys

About Contact Privacy policy Terms and conditions