• 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

phpunit - mockbuilder - set mock object internal property

Increase value by 1 on button click

Target Individual Form Instance/Counter Inside A PHP While Loop

Clear javascript source cache laravel 5.8

Coinpayments create_transaction "ERROR: Invalid command!"

Laravel multi auth - Authentication user provider [] is not defined

Why is this PHP array not the same?

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

Appending data to an anchor tag

How to add class name to an existing tag in php

Require a class from another class - php

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

Filter WooCommerce related products by Polylang language

Laravel: Create morphs() relationship nullable

java URL working on browser but not in client program

About Contact Privacy policy Terms and conditions