Handle error

package sso\lib

 Methods

Manually add a global error

addError(string $error) 
Static

Parameters

$error

string

Error message

Disable the ErrorHandler and restore previous handler

disable() 
Static

Enabled error and exception handling

dontIgnoreExceptionAndError() 
Static

Handle PHP error

handleError(integer $errno, string $errstr, string $errfile, \sso\number $errline, array $errcontext) 
Static

Parameters

$errno

integer

error number

$errstr

string

error message

$errfile

string

file of the error

$errline

\sso\number

line number of the error

$errcontext

array

context of the error

Handle exception

handleException(\Exception $exception) 
Static

Parameters

$exception

\Exception

Disable error handling

ignoreError() 
Static

Disable exception handling

ignoreException() 
Static

Set the ErrorHandler

init() 
Static

Convert arguments to string

dumpArg(mixed $arg) : string
Static

Parameters

$arg

mixed

can be anything

Returns

stringa string that represent the argument

Convert an error message in a valid charset.

fixEncoding(string $s) : string
Static

Some errors are in a different charset if the error came from a native system error.

Parameters

$s

string

the message in unknown charset

Returns

stringthe message in SSO charset

Replace the 2nd parameter of all auth* functions for avoid display user password in error messages and logs

hidePasswordInStack(\sso\Exception|array<mixed,mixed> $exception) 
Static

Parameters

$exception

\sso\Exceptionarray<mixed,mixed>

Exception or stack returned by debug_backtrace()

End a page with errors display

stopAndDisplayErrors() 
Static

 Properties

 

all error messages

$ERRORS : array<mixed,string>

Default

array()
Static
 

TRUE if ErrorHandler is active, FALSE otherwise

$active : boolean

Default

FALSE
Static
 

TRUE for ignore PHP errors

$ignoreError : boolean

Default

FALSE
Static
 

TRUE for ignore PHP exception

$ignoreException : boolean

Default

FALSE
Static

 Constants

 

<p>prefix for encapsuled errors</p>

SUBERROR_PREFIX = '  ' : string