Beispiel #1
0
 /**
  * Overloaded FileMaker_Error constructor.
  *
  * @param FileMaker_Delegate &$fm FileMaker_Delegate object this error
  *        came from.
  * @param string $message Error message.
  * @param integer $code Error code.
  */
 function FileMaker_Error(&$fm, $message = null, $code = null)
 {
     $this->_fm =& $fm;
     parent::__construct($message, $code);
     // Log the error.
     $fm->log($this->getMessage(), FILEMAKER_LOG_ERR);
 }
Beispiel #2
0
 /**
  * Mail_Queue_Error constructor.
  *
  * @param mixed   $code      Mail_Queue error code, or string with error message.
  * @param integer $mode      what 'error mode' to operate in
  * @param integer $level     what error level to use for
  *                           $mode & PEAR_ERROR_TRIGGER
  * @param string  $debuginfo additional debug info
  */
 function Mail_Queue_Error($code = MAILQUEUE_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $file = __FILE__, $line = __LINE__, $debuginfo = '')
 {
     $debuginfo .= (empty($debuginfo) ? '' : ' - ') . 'FILE: ' . $file . ', LINE: ' . $line;
     if (is_int($code)) {
         parent::__construct('Mail Queue Error: ' . Mail_Queue::errorMessage($code), $code, $mode, $level, $debuginfo);
     } else {
         parent::__construct('Mail Queue Error: ' . $code, MAILQUEUE_ERROR, $mode, $level, $debuginfo);
     }
 }
Beispiel #3
0
 /**
  * DB_Error constructor
  *
  * @param mixed $code       DB error code, or string with error message
  * @param int   $mode       what "error mode" to operate in
  * @param int   $level      what error level to use for $mode &
  *                           PEAR_ERROR_TRIGGER
  * @param mixed $debuginfo  additional debug info, such as the last query
  *
  * @see PEAR_Error
  */
 function __construct($code = DB_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
 {
     if (is_int($code)) {
         parent::__construct('DB Error: ' . DB::errorMessage($code), $code, $mode, $level, $debuginfo);
     } else {
         parent::__construct("DB Error: {$code}", DB_ERROR, $mode, $level, $debuginfo);
     }
 }
Beispiel #4
0
 /**
  * DB_DataObject_Error constructor.
  *
  * @param mixed   $code   DB error code, or string with error message.
  * @param integer $mode   what "error mode" to operate in
  * @param integer $level  what error level to use for $mode & PEAR_ERROR_TRIGGER
  * @param mixed   $debuginfo  additional debug info, such as the last query
  *
  * @access public
  *
  * @see PEAR_Error
  */
 function __construct($message = '', $code = DB_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE)
 {
     parent::__construct('DB_DataObject Error: ' . $message, $code, $mode, $level);
 }
Beispiel #5
0
 /**
  * MDB2_Schema_Error constructor.
  *
  * @param mixed     error code, or string with error message.
  * @param int       what 'error mode' to operate in
  * @param int       what error level to use for $mode & PEAR_ERROR_TRIGGER
  * @param mixed     additional debug info, such as the last query
  * @access  public
  */
 function __construct($code = MDB2_SCHEMA_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
 {
     parent::__construct('MDB2_Schema Error: ' . MDB2_Schema::errorMessage($code), $code, $mode, $level, $debuginfo);
 }
Beispiel #6
0
 /**
  * construct a new error instance
  *
  * You may either pass a message or an xml_parser resource as first
  * parameter. If a resource has been passed, the last error that
  * happened will be retrieved and returned.
  *
  * @param string|resource $msgorparser message or parser resource
  * @param integer         $code        error code
  * @param integer         $mode        error handling
  * @param integer         $level       error level
  *
  * @access   public
  * @todo PEAR CS - can't meet 85char line limit without arg refactoring
  */
 function __construct($msgorparser = 'unknown error', $code = 0, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE)
 {
     if (is_resource($msgorparser)) {
         $code = xml_get_error_code($msgorparser);
         $msgorparser = sprintf('%s at XML input line %d:%d', xml_error_string($code), xml_get_current_line_number($msgorparser), xml_get_current_column_number($msgorparser));
     }
     parent::__construct($msgorparser, $code, $mode, $level);
 }
Beispiel #7
0
 /**
  * Creates an cache error object.
  * 
  * @param  string  error message
  * @param  string  file where the error occured
  * @param  string  linenumber where the error occured
  */
 function Cache_Error($msg, $file = __FILE__, $line = __LINE__)
 {
     parent::__construct(sprintf("%s [%s on line %d].", $msg, $file, $line));
 }
Beispiel #8
0
 /**
  * Creates a quickform error object, extending the PEAR_Error class
  *
  * @param int   $code the error code
  * @param int   $mode the reaction to the error, either return, die or trigger/callback
  * @param int   $level intensity of the error (PHP error code)
  * @param mixed $debuginfo any information that can inform user as to nature of the error
  */
 public function __construct($code = QUICKFORM_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
 {
     if (is_int($code)) {
         parent::__construct(HTML_QuickForm::errorMessage($code), $code, $mode, $level, $debuginfo);
     } else {
         parent::__construct("Invalid error code: {$code}", QUICKFORM_ERROR, $mode, $level, $debuginfo);
     }
 }
Beispiel #9
0
 /**
  * MDB2_Error constructor.
  *
  * @param   mixed   MDB2 error code, or string with error message.
  * @param   int     what 'error mode' to operate in
  * @param   int     what error level to use for $mode & PEAR_ERROR_TRIGGER
  * @param   mixed   additional debug info, such as the last query
  */
 public function __construct($code = MDB2_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null, $dummy = null)
 {
     if (null === $code) {
         $code = MDB2_ERROR;
     }
     parent::__construct('MDB2 Error: ' . MDB2::errorMessage($code), $code, $mode, $level, $debuginfo);
 }
Beispiel #10
0
 /**
  * Net_LDAP2_Error constructor.
  *
  * @param string  $message   String with error message.
  * @param integer $code      Net_LDAP2 error code
  * @param integer $mode      what "error mode" to operate in
  * @param mixed   $level     what error level to use for $mode & PEAR_ERROR_TRIGGER
  * @param mixed   $debuginfo additional debug info, such as the last query
  *
  * @access public
  * @see PEAR_Error
  */
 public function __construct($message = 'Net_LDAP2_Error', $code = NET_LDAP2_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
 {
     if (is_int($code)) {
         parent::__construct($message . ': ' . Net_LDAP2::errorMessage($code), $code, $mode, $level, $debuginfo);
     } else {
         parent::__construct("{$message}: {$code}", NET_LDAP2_ERROR, $mode, $level, $debuginfo);
     }
 }