• 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

selected value from the listbox in php

How to identify whether webp image is static or animated?

Check if string contains a value in array [duplicate]

how to validate form data in codeigniter 4

How to Generate PDF invoice to XML format using mPDF

php: command not found Command PhaseScriptExecution failed with a nonzero exit code

Parameter is not sent to Laravel route in Ajax

Currently Using CodeIgniter Framework i have an Error

Results page in other window

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

Image upload not working through ajax Laravel

Add restriction to WooCommerce coupons by allowed user ID

Fetch files from next cloud storage and display in Laravel website

How do I upload a laravel project on cPanel shared hosting?

how to get the header value, if we don't know the value because the value is random from the server

About Contact Privacy policy Terms and conditions