Files
crewsportswear/app/Exceptions/Handler.php
Frank John Begornia 701a433174
All checks were successful
Deploy Production (crewsportswear.com) / deploy (push) Successful in 1m51s
Update exception handling in Handler and TestEmailController for improved error reporting
2026-02-26 22:58:28 +08:00

49 lines
1.1 KiB
PHP

<?php namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler {
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report($e)
{
if (!$e instanceof Exception) {
$e = new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
}
return parent::report($e);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param mixed $e
* @return \Illuminate\Http\Response
*/
public function render($request, $e)
{
if (!$e instanceof Exception) {
$e = new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
}
return parent::render($request, $e);
}
}