ExceptionHandler

Displays the custom error page when an uncaught exception occurs.

since

3.0

package

Application

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(int errorNumber, string errorMessage, string errorFile, int errorLine) : bool
static
since

4.0.0

Arguments

errorNumber

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

errorMessage

stringThe error message.

errorFile

stringThe file the error was triggered from.

errorLine

intThe line number the error was triggered from.

Response

bool

isException

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

isException(mixed error) : bool
static
since

3.10.0

Arguments

error

mixedAny error value.

Response

bool

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.