• 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

Laravel: HTML in notification

Adding the custom page with add_menu_page function on Wordpress

How to disable widget block editor of WordPress?

CSS file not imported in laravel blade view

dompdf and img tag, image wont show

How to get page number on dompdf PDF when using "view"

Laravel/docker-compose/redis - Class 'Redis' not found

How in Laravel run JavaScript code stored in php variable?

Message: Set sys_temp_dir in your php.ini after installed composer

Toggle between a textbox and a select using PHP

How to use React Router with Laravel?

Extract string between first whitespace and last whitespace in php

How to fix " Uncaught TypeError: Argument 1 passed to JpGraphException::defaultHandler() " problem in php 7.1.3 and jpgraph 4.2.6?

How to break out of a foreach once a condition is met?

how can I set a session variable in Drupal 8 and get it in a php script?

About Contact Privacy policy Terms and conditions