• 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

PHP usort() order in case of equality

Limit WooCommerce products in cart only from one custom taxonomy

Set quantity minimum, maximum and step at product level in Woocommerce

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

Using PHP to connect to a remote MSSQL database

Laravel insert dynamic input values with radio button

How can I get a div content in php

Facebook PHP SDK - will not logout properly

Which is faster php date functions or carbon?

PHP: How to quickly split a key=value file into associative array

500 (Internal Server Error) with Laravel & Docker [duplicate]

Having issue with matching rows in the database using PDO

Laravel 5.2: Unable to locate factory with name [default]

zsh: command not found: php

file_put_content...fail to open stream:Permission denied in Laravel 5

About Contact Privacy policy Terms and conditions