• 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

Object of class stdClass could not be converted to string error

Laravel Pagination links() not working

Show only featured products in Woocommerce shop page

laravel controller function parameters

How to create laravel storage symbolic link for production or sub domain system?

Cross-Origin Resource Sharing (CORS) witth Laravel and Vuejs

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

How to increase the PHP upload limits [duplicate]

How to test laravel controller method?

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

Adding Multiple Custom Post Types in Wordpress

Add Class in html Dynamically in PHP

Laravel query builder binding parameters more than once

About Contact Privacy policy Terms and conditions