Handler
Implements
Uses
Properties
$dontReport
array>
A list of the exception types that are not reported.
$reportCallbacks Illuminate\...\ReportableHandler[]
The callbacks that should be used during reporting.
$levels
array
A map of exceptions with their corresponding custom log levels.
$renderCallbacks Closure[]
The callbacks that should be used during rendering.
$exceptionMap
array
The registered exception mappings.
$internalDontReport
array>
A list of the internal exception types that should not be reported.
$dontFlash
array
A list of the inputs that are never flashed for validation exceptions.
Methods
__construct ( Container $container ) : void
Create a new exception handler instance.
Parameters
- $container Container
register ( ) : void
Register the exception handling callbacks for the application.
reportable ( callable $reportUsing ) : ReportableHandler
Register a reportable callback.
Parameters
- $reportUsing callable
renderable ( callable $renderUsing ) : $this
Register a renderable callback.
Parameters
- $renderUsing callable
map ( $from , $to ) : $this
Register a new exception mapping.
Parameters
ignore ( string $class ) : $this
Indicate that the given exception type should not be reported.
Parameters
- $class string
level ( $type , $level ) : $this
Set the log level for the given exception type.
Parameters
- $type class-string<\Throwable>
- $level Psr\...\LogLevel::*
reportThrowable ( Throwable $e ) : void
Reports error based on report method on exception or to logger.
Parameters
- $e Throwable
shouldReport ( Throwable $e ) : bool
Determine if the exception should be reported.
Parameters
- $e Throwable
shouldntReport ( Throwable $e ) : bool
Determine if the exception is in the "do not report" list.
Parameters
- $e Throwable
stopIgnoring ( string $exception ) : $this
Remove the given exception class from the list of exceptions that should be ignored.
Parameters
- $exception string
buildExceptionContext ( Throwable $e ) : array
Create the context array for logging the given exception.
Parameters
- $e Throwable
exceptionContext ( Throwable $e ) : array
Get the default exception context variables for logging.
Parameters
- $e Throwable
context ( ) : array
Get the default context variables for logging.
render ( $request , Throwable $e ) : Symfony\...\Response
Render an exception into an HTTP response.
Parameters
prepareException ( Throwable $e ) : Throwable
Prepare exception for rendering.
Parameters
- $e Throwable
mapException ( Throwable $e ) : Throwable
Map the exception using a registered mapper if possible.
Parameters
- $e Throwable
renderViaCallbacks ( $request , Throwable $e ) : mixed
Try to render a response from request and exception via render callbacks.
Parameters
renderExceptionResponse ( $request , Throwable $e ) : Response |RedirectResponse
Render a default exception response if any.
Parameters
unauthenticated ( $request , AuthenticationException $exception ) : Response |RedirectResponse
Convert an authentication exception into a response.
Parameters
- $request Request
- $exception AuthenticationException
convertValidationExceptionToResponse ( ValidationException $e , $request ) : Symfony\...\Response
Create a response object from the given validation exception.
Parameters
- $e ValidationException
- $request Request
invalid ( $request , ValidationException $exception ) : Response |RedirectResponse
Convert a validation exception into a response.
Parameters
- $request Request
- $exception ValidationException
invalidJson ( $request , ValidationException $exception ) : JsonResponse
Convert a validation exception into a JSON response.
Parameters
- $request Request
- $exception ValidationException
shouldReturnJson ( $request , Throwable $e ) : bool
Determine if the exception handler response should be JSON.
Parameters
prepareResponse ( $request , Throwable $e ) : Response |RedirectResponse
Prepare a response for the given exception.
Parameters
convertExceptionToResponse ( Throwable $e ) : Symfony\...\Response
Create a Symfony response for the given exception.
Parameters
- $e Throwable
renderExceptionContent ( Throwable $e ) : string
Get the response content for the given exception.
Parameters
- $e Throwable
renderExceptionWithCustomRenderer ( Throwable $e ) : string
Render an exception to a string using the registered ExceptionRenderer
.
Parameters
- $e Throwable
renderExceptionWithSymfony ( Throwable $e , $debug ) : string
Render an exception to a string using Symfony.
Parameters
- $e Throwable
- $debug bool
renderHttpException ( Symfony\...\HttpExceptionInterface $e ) : Symfony\...\Response
Render the given HttpException.
Parameters
- $e Symfony\...\HttpExceptionInterface
registerErrorViewPaths ( ) : void
Register the error template hint paths.
getHttpExceptionView ( Symfony\...\HttpExceptionInterface $e ) : string|null
Get the view used to render HTTP exceptions.
Parameters
- $e Symfony\...\HttpExceptionInterface
toIlluminateResponse ( $response , Throwable $e ) : Response |RedirectResponse
Map the given exception into an Illuminate response.
Parameters
- $response Symfony\...\Response
- $e Throwable
prepareJsonResponse ( $request , Throwable $e ) : JsonResponse
Prepare a JSON response for the given exception.
Parameters
convertExceptionToArray ( Throwable $e ) : array
Convert the given exception to an array.
Parameters
- $e Throwable