ExceptionHandler
in package

This is the ExceptionHandler class.

The purpose of this class is to manage exceptions.

Tags
example

It is used by our user-defined exception handler function to be called when an uncaught exception occurs (FWK\Core\Exceptions\ErrorCapturer.php -> exceptionCapturerFWK)

see
ExceptionHandler::errorDumper()
see
ExceptionHandler::runException()
see
ExceptionHandler::error()

Table of Contents

__construct() Constructor.  : mixed
error() This method generates a log of the error, outputs it only in DEVEL mode, and returns a string indicating "ERROR" if $nestedError is null or "NestedError" otherwise.  : string
errorDumper() This method returns an string with the dump of the Throwable element given by parameter.  : string
runException() This method runs the exception management.  : string

Methods

__construct()

Constructor.

public __construct(Throwable $e) : mixed
Parameters
$e : Throwable

Exception to manage.

Return values
mixed

error()

This method generates a log of the error, outputs it only in DEVEL mode, and returns a string indicating "ERROR" if $nestedError is null or "NestedError" otherwise.

public error([ $nestedError = null ]) : string
Parameters
$nestedError : = null
Return values
string

errorDumper()

This method returns an string with the dump of the Throwable element given by parameter.

public static errorDumper(Throwable $e) : string
Parameters
$e : Throwable
Return values
string

runException()

This method runs the exception management.

public runException([string $type = 'undefined' ][, bool $staticRedirect = false ]) : string
  1. It saves a log of the error.
  2. It outputs the error.
    -If staticRedirect is true then it outputs an static 503 error output calling to FWK\Core\Exceptions\ErrorWithoutController.php
    -If staticRedirect is false then it enroutes the request to error controller and executes it.
The string type parameter is used to save it in the log, to set a type in a non-static redirect and to concatenate it in the return string.
This method also returns an string indicating 'Request uncompleted ' concatenated with the type pased by parameter.
Parameters
$type : string = 'undefined'
$staticRedirect : bool = false
Tags
see

FWK\Core\Exceptions\ErrorWithoutController.php This is the static error page for staticRedirect cases.

Return values
string

Search results