setErrorHandling() can be invoked both as objects and statically. If called statically, setErrorHandling() sets the default behaviour for all PEAR objects. If called as an object member, setErrorHandling() sets the default behaviour for that object.
integer $mode - one of the following constants
PEAR_ERROR_RETURN If an error occurs, a PEAR_Error is returned by the function, where the error happened.
PEAR_ERROR_PRINT Like PEAR_ERROR_RETURN, but an error message will be printed additionally.
PEAR_ERROR_TRIGGER Like PEAR_ERROR_RETURN, but the PHP builtin-function trigger_error() will be executed additionally.
PEAR_ERROR_DIE The script will be finish and an error message will be printed, if an error occurs.
PEAR_ERROR_CALLBACK If a error occurs, the indicated error handler function is called. This function has to support a parameter to receive the PEAR_Error object.
mixed $options - the value for the options depends on $mode
PEAR_ERROR_PRINT and PEAR_ERROR_PRINT support an optional printf() format string used when printing the error message.
PEAR_ERROR_TRIGGER requires a user level indication ( possible constants: E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
PEAR_ERROR_CALLBACK requires the indication of the function to invoke as string. Or, if the function a class member, an array containing the class name and the function name.