• 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

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

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

Yii2 redirecting to previous page after login

Natural ORDER in Laravel Eloquent ORM

ConstraintViolationListInterface to Exception in Symfony

Is there a way to use the same parameter into multiple place in the same query with Eloquent? [duplicate]

Star and Half Star Rating in Laravel

PHP SoapClient: set a namespace without prefix

With doctrine ODM, can I embed many subdocuments in a main document?

Adding multiple items to WooCommerce cart at once

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

how to pass row id in href of a tag in codeigniter controller?

dockerizing Laravel + vue

AJAX call fails with SyntaxError: Unexpected end of JSON input

About Contact Privacy policy Terms and conditions