/** * This method is used to communicate an error and invoke error * callbacks etc. Basically a wrapper for PEAR::raiseError * without the message string. * * @param mixed integer error code, or a PEAR error object (all * other parameters are ignored if this parameter is * an object * * @param int error mode, see PEAR_Error docs * * @param mixed If error mode is PEAR_ERROR_TRIGGER, this is the * error level (E_USER_NOTICE etc). If error mode is * PEAR_ERROR_CALLBACK, this is the callback function, * either as a function name, or as an array of an * object and method name. For other error modes this * parameter is ignored. * * @param string Extra debug information. Defaults to the last * query and native error code. * * @return object a PEAR error object * * @see PEAR_Error */ function &raiseError($code = null, $mode = null, $options = null, $userinfo = null) { // The error is yet a LiveUser error object if (is_object($code)) { return PEAR::raiseError($code, null, null, null, null, null, true); } if (empty($code)) { $code = LIVEUSER_ERROR; } $msg = LiveUser::errorMessage($code); return PEAR::raiseError("LiveUser Error: {$msg}", $code, $mode, $options, $userinfo); }