PEAR_Error PEAR::raiseError (
mixed $message
,
int $code
,
int $mode
,
int|array $options
,
mixed $userinfo
,
string $error_class
,
boolean $skipmsg
)
raiseError()
$message
Error message string or PEAR_Error object.
The default message is unknown error
if left blank.
$code
Error code. It is recommended to use an error code for even the simplest errors, in order to simplify error handling and processing.
$mode
Error mode. This is one of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, PEAR_ERROR_CALLBACK, or PEAR_ERROR_EXCEPTION. See setErrorHandling() for detailed information and examples of the meaning of these constants.
$options
Error options. This depends on the value of $mode
,
and is documented in setErrorHandling().
$userinfo
Optional user information. This can be used to store any error-specific information, and has an unspecified format.
$error_class
Error class name to use as the error object. The default error class is PEAR_Error. Use this parameter to specify another class to use, such as a custom class extending PEAR_Error
$skipmsg
Use this parameter if you are using a custom class that does not
accept an error message in its constructor. Never
use this parameter without the $error_class
parameter - it will not work.
A PEAR_Error object is returned, unless PEAR_ERROR_DIE terminates execution or a PEAR_ERROR_EXCEPTION is never handled.