ldc-supportweb/app/Exceptions/Handler.php

48 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2020-11-18 10:23:51 +01:00
<?php
namespace App\Exceptions;
2022-12-15 09:10:17 +01:00
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
2020-11-18 10:23:51 +01:00
class Handler extends ExceptionHandler
{
/**
* A list of exception types with their corresponding custom log levels.
*
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/
protected $levels = [];
2020-11-18 10:23:51 +01:00
/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<\Throwable>>
2020-11-18 10:23:51 +01:00
*/
protected $dontReport = [];
2020-11-18 10:23:51 +01:00
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array<int, string>
2020-11-18 10:23:51 +01:00
*/
protected $dontFlash = [
'current_password',
2020-11-18 10:23:51 +01:00
'password',
'password_confirmation',
];
/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register(): void
2020-11-18 10:23:51 +01:00
{
2022-12-15 09:10:17 +01:00
$this->reportable(function (\Throwable $e) {
if (app()->bound('sentry')) {
app('sentry')->captureException($e);
}
});
2020-11-18 10:23:51 +01:00
}
}