• 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 get company posts from LinkedIn via API?

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

How to get the total hour from starting time to end time in php

Live search query using JS and PHP for QA forum

Laravel database insert with combining array and string

Unit (real unit test) of test laravel relationship

How to identify whether webp image is static or animated?

WooCommerce Subscriptions: Remove role on cancelled subscription

Laravel Displaying image from database

using random function but it's displaying duplicates

How to Make Laravel Eloquent "IN" Query?

Laravel Command Schedule Not Working Properly

Make Calculator - When Button clicked the No shows in Textbox.

Converting array to string and then back in PHP

Create tags in laravel post publishing

About Contact Privacy policy Terms and conditions