• 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

500 Internal Server Error on Ajax request. Not sure the origin of the problem

Target class controller does not exist - Laravel 8

How to check user Permissions using Custom Middleware in Laravel

how to validate form data in codeigniter 4

Laravel Collections. Is there some kind of assertStructure method?

Laravel 5.5 change unauthenticated login redirect url

How to display MySQL table using php and edit it in a web browser

getting error while enter Command => php artisan route:list

How to change HTML structure inside WP <head>

How to upload mpdf file after generating to s3 bucket in php

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

How to create a cookie to store the timestamp of when a page is first loaded with php

Laravel 8: Array to string conversion while calling route:list

Accessors (Getter) & Mutators (Setter) On a Pivot Table in Laravel

api response laravel doesn't show

About Contact Privacy policy Terms and conditions