PHP Manual

PEAR Manual

Smarty Manual

PostgreSQL

MySQL Manual

Perl Manual

pear::raiseerror()

pear::raiseerror() -- create a new pear_error object and optionally specify error-handling instructions

description

raiseerror()

parameter

string $message

error message string or pear_error object. the default message is unknown error if left blank.

integer $code

error code. it is recommended to use an error code for even the simplest errors, in order to simplify error handling and processing.

integer $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.

mixed $options

error options. this depends on the value of $mode, and is documented in seterrorhandling().

mixed $userinfo

optional user information. this can be used to store any error-specific information, and has an unspecified format.

string $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

boolean $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.

return value

a pear_error object is returned, unless pear_error_die terminates execution or a pear_error_exception is never handled.