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.

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(\Exception|\Throwable $error) : void
static
since

3.10.0

Arguments

$error

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

render

Render the error page based on an exception.

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

3.0

Arguments

$error

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