Documentation

HandleExceptions
in package

Table of Contents

$app  : Application
The application instance.
bootstrap()  : void
Bootstrap the given application.
handleError()  : void
Convert PHP errors to ErrorException instances.
handleException()  : void
Handle an uncaught exception from the application.
handleShutdown()  : void
Handle the PHP shutdown event.
fatalExceptionFromError()  : FatalErrorException
Create a new fatal exception instance from an error array.
getExceptionHandler()  : ExceptionHandler
Get an instance of the exception handler.
isFatal()  : bool
Determine if the error type is fatal.
renderForConsole()  : void
Render an exception to the console.
renderHttpResponse()  : void
Render an exception as an HTTP response and send it.

Properties

Methods

handleError()

Convert PHP errors to ErrorException instances.

public handleError(int $level, string $message[, string $file = '' ], int $line[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : int
$message : string
$file : string = ''
$line : int
$context : array<string|int, mixed> = []
Tags
throws
ErrorException
Return values
void

handleException()

Handle an uncaught exception from the application.

public handleException(Throwable $e) : void

Note: Most exceptions can be handled via the try / catch block in the HTTP and Console kernels. But, fatal error exceptions must be handled differently since they are not normal exceptions.

Parameters
$e : Throwable
Return values
void

handleShutdown()

Handle the PHP shutdown event.

public handleShutdown() : void
Return values
void

fatalExceptionFromError()

Create a new fatal exception instance from an error array.

protected fatalExceptionFromError(array<string|int, mixed> $error[, int|null $traceOffset = null ]) : FatalErrorException
Parameters
$error : array<string|int, mixed>
$traceOffset : int|null = null
Return values
FatalErrorException

isFatal()

Determine if the error type is fatal.

protected isFatal(int $type) : bool
Parameters
$type : int
Return values
bool

renderForConsole()

Render an exception to the console.

protected renderForConsole(Exception $e) : void
Parameters
$e : Exception
Return values
void

renderHttpResponse()

Render an exception as an HTTP response and send it.

protected renderHttpResponse(Exception $e) : void
Parameters
$e : Exception
Return values
void

Search results