2022-08-05 09:38:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Exceptions;
|
|
|
|
|
|
2023-01-10 16:58:53 +01:00
|
|
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
2022-08-05 09:38:44 +00:00
|
|
|
|
|
|
|
|
class Handler extends ExceptionHandler
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* A list of the exception types that are not reported.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
2026-10-27 15:12:56 +01:00
|
|
|
#[\Override]
|
2022-08-05 09:38:44 +00:00
|
|
|
protected $dontReport = [];
|
|
|
|
|
|
|
|
|
|
/**
|
2023-01-10 16:58:53 +01:00
|
|
|
* Register
|
2022-08-05 09:38:44 +00:00
|
|
|
* @return void
|
|
|
|
|
*/
|
2023-01-10 16:58:53 +01:00
|
|
|
public function register()
|
2022-08-05 09:38:44 +00:00
|
|
|
{
|
2026-10-27 15:12:56 +01:00
|
|
|
$this->reportable(function (\Throwable $e): void {
|
2023-01-10 16:58:53 +01:00
|
|
|
if (app()->bound('sentry')) {
|
2026-10-27 15:12:56 +01:00
|
|
|
resolve('sentry')->captureException($e);
|
2023-01-10 16:58:53 +01:00
|
|
|
}
|
|
|
|
|
});
|
2022-08-05 09:38:44 +00:00
|
|
|
}
|
|
|
|
|
}
|