• 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 run a shell as root from php (apache)

Adding one microsecond to Datetime object in PHP

Convert PHP array into HTML tag attributes separated by spaces

How to test laravel controller method?

Required field only if another field has a value, must be empty otherwise

I'm trying to use curl with php but getting this error:Could not resolve host: Bearer

Laravel Excel::store file empty after stored

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

How to add class name to an existing tag in php

file_get_contents() without "Http" to access external URL [closed]

send email using gmail-api and google-api-php-client

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

Laravel Displaying image from database

How to edit Records using CodeIgniter

About Contact Privacy policy Terms and conditions