ExceptionHandler

Displays the custom error page when an uncaught exception occurs.

since

3.0

Methods

handleException

Handles exceptions: logs errors and renders error page.

handleException(\Exception|\Throwable $error) : void
static
since

3.10.0

Arguments

$error

\Exception|\ThrowableAn Exception or Throwable (PHP 7+) object for which to render the error page.

handleUserDeprecatedErrors

Handles an error triggered with the E_USER_DEPRECATED level.

handleUserDeprecatedErrors(integer $errorNumber, string $errorMessage, string $errorFile, integer $errorLine) : boolean
static
since

4.0.0

Arguments

$errorNumber

integerThe level of the raised error, represented by the E_* constants.

$errorMessage

stringThe error message.

$errorFile

stringThe file the error was triggered from.

$errorLine

integerThe line number the error was triggered from.

Response

boolean

isException

Checks if given error belong to PHP exception class (\Throwable for PHP 7+, \Exception for PHP 5-).

isException(mixed $error) : boolean
static
since

3.10.0

Arguments

$error

mixedAny error value.

Response

boolean

logException

Logs exception, catching all possible errors during logging.

logException(\Throwable $error) : void
static
since

3.10.0

Arguments

$error

\ThrowableAn Exception or Throwable (PHP 7+) object to get error message from.

render

Render the error page based on an exception.

render(\Throwable $error) : void
static
since

3.0

Arguments

$error

\ThrowableAn Exception or Throwable (PHP 7+) object for which to render the error page.