• 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

Sliders in Laravel

Laravel-fopen: failed to open stream: Permission denied

Symfony - "framework.test" config is not set to true

How to find phpcs current default standard

best way to store error messages in Laravel (session or variable)

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

Extract string between first whitespace and last whitespace in php

How to average columns of data from multiple, flat arrays?

laravel MVC execution flow

How can I make this nested location configuration use the correct path to call a php program?

Eloquent insert id with sequence next value

I want a way to give path to my files which are outside of public folder in laravel

Class AppHttpControllersUserController Does Not Exist

how to youtube api data to print in toolset metabox using a button click before save-post

How to implement placeholder in a php file for moodle plugin?

About Contact Privacy policy Terms and conditions