This object is the error handler

uses the exception handler
package OWR
used_by \OWR\CLI\Controller
used_by \OWR\REST\Controller
used_by \OWR\Controller

 Methods

Constructor Will call Exception::__construct, send header if not already done

__construct(string $errstr, int $errno) 
author Pierre-Alain Mignot
access public

Parameters

$errstr

string

the error message

$errno

int

the error code

Executed when the object is used as a string Returns the contents of the exception

__toString() 
Inherited
author Pierre-Alain Mignot
access public
inherited_from \OWR\Exception::__toString()

Error handler This function either throws an exception or just ignores the message if error level is lower than error code

error_handler(int $errno, string $errstr, string $errfile, int $errline) : mixed
Static
author Pierre-Alain Mignot
access public
static

Parameters

$errno

int

the error code

$errstr

string

the error message

$errfile

string

the file where the error occured

$errline

int

the line where the error occured

Returns

mixedtrue if not fatal

Exception handler

exception_handler(mixed $exception) 
InheritedStatic
author Pierre-Alain Mignot
access public
static
inherited_from \OWR\Exception::exception_handler()

Parameters

$exception

mixed

the exception object

Return the error message if debug, else a standard message

getContent() 
Inherited
author Pierre-Alain Mignot
access public
inherited_from \OWR\Exception::getContent()

 Properties

 

list of errors type

$_type : array
access protected
static

 Constants

 

<p>custom error type</p>

E_OWR_BAD_REQUEST : int
Inherited
inherited_from \OWR\Exception::E_OWR_BAD_REQUEST
 

<p>custom error type</p>

E_OWR_DIE : int
Inherited
inherited_from \OWR\Exception::E_OWR_DIE
 

<p>custom error type</p>

E_OWR_NOTICE : int
Inherited
inherited_from \OWR\Exception::E_OWR_NOTICE
 

<p>custom error type</p>

E_OWR_UNAUTHORIZED : int
Inherited
inherited_from \OWR\Exception::E_OWR_UNAUTHORIZED
 

<p>custom error type</p>

E_OWR_UNAVAILABLE : int
Inherited
inherited_from \OWR\Exception::E_OWR_UNAVAILABLE
 

<p>custom error type</p>

E_OWR_WARNING : int
Inherited
inherited_from \OWR\Exception::E_OWR_WARNING