Nexista_ErrorThe Nexista error system is Exception based and provides a method for calling custom handler for each error type.
The extension class Nexista_used by Nexista extends from the standard PHP5 Exception class Nexista_with added functionality. It aims to be self supporting meaning that try/catch blocks do not need to be called.
Each place where an error might happen has the directive:
Each class Nexista_or functionality group can have it's own error codes and handlers. For example, a database class Nexista_might have:
The error system does not log or display errors by default. Observers need to be setup in the prepend file in order to do so:
Credits: This class Nexista_was inspired by the PEAR_Exception class
Located in /kernel/error.php (line 84)
Exception | --Nexista_Error
static addObserver (line 180)
Adds an observer function
All registered observers are called when an exception occurs and can be used to display,log, notify.
static init (line 163)
Inits a new Exception with optional handler
This static method is called instead of a throw command. It instanciates a new execption and allows for an optional handler to be defined to handle the exception
static registerDefaultHandler (line 410)
Registers a function to be called on error if no custom handlers are defined
This method allows a callable function to be called for standard errors (i.e. NX_ERROR_FATAL, NX_ERROR_WARNING) to override the default actions. Note that if a custome handler for an error is defined in the Error:init() arguments, this function will never be called. This function should accept 1 argument: a reference to the current Error object.
static removeObserver (line 193)
Removes an observer
Constructor __construct (line 120)
Instantiates a new Nexista Exception
disableObservers (line 223)
Disable all or one observer
When an external handler is used, it may be desirable not to call the observer(s). This method can be used to do so.
enableObservers (line 238)
Enable previously disabled observer(s)
getErrorClass (line 290)
Returns class Nexista_where exception occured
getErrorMethod (line 301)
Returns method where exception occured
getTraceSafe (line 273)
Returns error trace
outputXml (line 313)
Outputs error as XML
processHandler (line 202)
Runs a user provided function to deal with this exception
toHtml (line 365)
Transforms and outputs XML error with XSL
toText (line 392)
Outputs error as string
triggerObservers (line 255)
Activate observers
This method is triggered by the Error::init() method when no handlers are defined and will call all registered observers. It is up to the handler, if defined, to call this method.
Inherited From Exception (Internal Class)
constructor __construct ( [$message = ], [$code = ] )
getCode ( )
getFile ( )
getLine ( )
getMessage ( )
getTrace ( )
getTraceAsString ( )
__clone ( )
__toString ( )
Documentation generated on Tue, 11 Mar 2008 23:23:00 -0400 for Nexista 0.2.0