• 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

curl returning 301 error after migrating to https

PHP Download MP3 files from directory on server

zsh: command not found: php

PHP mail function is sending blank message body

I want to use codeigniter foreign character library in my custom PHP project how i can use it?

Confirm Leave on External Links in Wordpress

How can I pass the list to the component variable in Laravel?

Saving Data from form to database using AngularJS and php

Lexik JWT authentication problem "Invalid credentials"

PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll

How to put php code inside opening and closing shortcodes

MISSING UPDATES FOR: MEDIA Drupal 9

Shopify password update using Shopify API

Filter array by skipping every nth element from the end

Check if user online laravel

About Contact Privacy policy Terms and conditions