Class Error

Description

Contains error-related functions and Habari's error handler.

Located in /system/classes/error.php (line 8)

Exception
   |
   --Error
Variable Summary
mixed $is_error
mixed $message
Method Summary
static void error_handler ( $errno,  $errstr,  $errfile,  $errline,  $errcontext)
static void exception_handler ( $exception)
static void handle_errors ()
static void is_error ( $obj)
static void raise ( $error_message, [ $severity = E_USER_ERROR])
Error __construct ([string $message = 'Generic Habari Error'], [integer $code = 0], [boolean $is_error = false])
void get ()
string humane_error ()
void out ()
Variables
mixed $is_error = false (line 11)
  • access: protected
mixed $message = '' (line 10)
  • access: protected

Redefinition of:
Exception::$message

Inherited Variables

Inherited from Exception (Internal Class)

$code
$file
$line
$message
$string
$trace
Methods
static method error_handler (line 86)

Used to handle all PHP errors after Error::handle_errors() is called.

  • access: public
static void error_handler ( $errno,  $errstr,  $errfile,  $errline,  $errcontext)
  • $errno
  • $errstr
  • $errfile
  • $errline
  • $errcontext
static method exception_handler (line 40)

Used to handle all uncaught exceptions.

  • access: public
static void exception_handler ( $exception)
  • $exception
static method handle_errors (line 31)

function handle_errors

Configures the Error class to handle all errors.

  • access: public
static void handle_errors ()
static method is_error (line 238)

function is_error

Returns true if the argument is an Error instance

  • access: public
static void is_error ( $obj)
  • $obj
static method raise (line 228)

function raise

Convenience method to create and return a new Error object

  • access: public
static void raise ( $error_message, [ $severity = E_USER_ERROR])
  • $error_message
  • $severity
Constructor __construct (line 20)

Constructor for the Error class

  • access: public
Error __construct ([string $message = 'Generic Habari Error'], [integer $code = 0], [boolean $is_error = false])
  • string $message: Exception to display
  • integer $code: Code of the exception
  • boolean $is_error: true if the exception represents an error handled by the Error class

Redefinition of:
Exception::constructor __construct ( [$message = ], [$code = ] )
get (line 218)

function get

Returns the error message in plain text

  • access: public
void get ()
humane_error (line 72)

Get the error text, file, and line number from the backtrace, which is more accurate

  • return: The contructed error string
  • access: public
string humane_error ()
out (line 203)

function out

Outputs the error message in plain text

  • access: public
void out ()

Inherited Methods

Inherited From Exception (Internal Class)

constructor __construct ( [$message = ], [$code = ] )
getCode ( )
getFile ( )
getLine ( )
getMessage ( )
getTrace ( )
getTraceAsString ( )
__clone ( )
__toString ( )

Documentation generated on Thu, 30 Oct 2008 20:31:09 +0100 by phpDocumentor 1.3.2