General
extends Exception
in package
Stop Exception
This is a general exception thrown from the leaf app
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- configure() : mixed
- Configure exception handler
- csrf() : mixed
- CSRF error
- default404() : mixed
- Default Not Found handler
- defaultDown() : mixed
- Default Not Found handler
- defaultError() : mixed
- Default Error handler
- error() : mixed
- Generic error page
- handleErrors() : bool
- Convert errors into ErrorException objects
- toException() : void|ErrorException
- Returns ErrorException objects from errors
- errorMarkup() : string
- Generate diagnostic template markup
- exceptionMarkup() : string
- Generate diagnostic template markup
- handleException() : mixed
- Handles an exception
- renderBody() : string
- Render response body
Properties
$config
protected
mixed
$config
= []
$response
protected
mixed
$response
Methods
__construct()
public
__construct(mixed $throwable) : mixed
Parameters
- $throwable : mixed
configure()
Configure exception handler
public
configure(mixed $config) : mixed
Parameters
- $config : mixed
csrf()
CSRF error
public
static csrf([mixed $error = null ]) : mixed
Parameters
- $error : mixed = null
default404()
Default Not Found handler
public
static default404() : mixed
defaultDown()
Default Not Found handler
public
static defaultDown() : mixed
defaultError()
Default Error handler
public
static defaultError([mixed $e = null ]) : mixed
Parameters
- $e : mixed = null
error()
Generic error page
public
static error(mixed $title, mixed $message[, mixed $code = 500 ]) : mixed
Parameters
- $title : mixed
- $message : mixed
- $code : mixed = 500
handleErrors()
Convert errors into ErrorException objects
public
static handleErrors(int $errno[, string $errstr = '' ][, string $errfile = '' ][, int $errline = '' ]) : bool
This method catches PHP errors and converts them into \ErrorException objects; these \ErrorException objects are then thrown and caught by Leaf's built-in or custom error handlers.
Parameters
- $errno : int
-
The numeric type of the Error
- $errstr : string = ''
-
The error message
- $errfile : string = ''
-
The absolute path to the affected file
- $errline : int = ''
-
The line number of the error in the affected file
Tags
Return values
booltoException()
Returns ErrorException objects from errors
public
static toException(int $errno[, string $errstr = '' ][, string $errfile = '' ][, int $errline = '' ]) : void|ErrorException
This method catches PHP errors and converts them into \ErrorException objects; these \ErrorException objects are then thrown and caught by Leaf's built-in or custom error handlers.
Parameters
- $errno : int
-
The numeric type of the Error
- $errstr : string = ''
-
The error message
- $errfile : string = ''
-
The absolute path to the affected file
- $errline : int = ''
-
The line number of the error in the affected file
Return values
void|ErrorExceptionerrorMarkup()
Generate diagnostic template markup
protected
static errorMarkup(string $title, string $body) : string
This method accepts a title and body content to generate an HTML document layout.
Parameters
- $title : string
-
The title of the HTML template
- $body : string
-
The body content of the HTML template
Return values
stringexceptionMarkup()
Generate diagnostic template markup
protected
static exceptionMarkup(string $title, string $body) : string
This method accepts a title and body content to generate an HTML document layout.
Parameters
- $title : string
-
The title of the HTML template
- $body : string
-
The body content of the HTML template
Return values
stringhandleException()
Handles an exception
protected
handleException(mixed $throwable) : mixed
Parameters
- $throwable : mixed
renderBody()
Render response body
protected
static renderBody(Exception $exception) : string
Parameters
- $exception : Exception