App::Framework::Base::Object::ErrorHandle - Adds error handling to basic object
use App::Framework::Base::Object::ErrorHandle ;
Any object derived from this class can throw an error and some registered error handler will catch (and handle) that error.
Hierarchy of catch handlers is:
catch_fn set for this object instance any registered global catch function (last registered first) default handler
Global catch functions, when registered, are added to a stack so that the last one registered is called first.
Each handler must return either 1=handled, or 0=not handled to tell this object whether to move on to the next handler.
NOTE: The default handler may be over-ridden by any derived object.
This object is set up such that when used as stand-alone objects (i.e. outside of an application framework), then errors are handled with die(), warn() etc.
Setting the debug flag to level 1 prints out (to STDOUT) some debug messages, setting it to level 2 prints out more verbose messages.
Steve Price <sdprice at cpan.org>
<sdprice at cpan.org>
None that I know of!
Create a new App::Framework::Base::Object::ErrorHandle.
The %args are specified as they would be in the set method, for example:
'mmap_handler' => $mmap_handler
The full list of possible arguments are :
'fields' => Either ARRAY list of valid field names, or HASH of field names with default values
Initialises the App::Framework::Base::Object::ErrorHandle object class variables. Creates a class instance so that these methods can also be called via the class (don't need a specific instance)
Add a new error to the Class list keeping track of all runtime errors
%args hash contains:
* type = fatal, nonfatal, warning, note * message = text message * errorcode = integer error code value
Returns a hash containing the information from the last error stored in the global list
Hash contains:
If there are no errors, returns undef
Returns the list of all errors
Returns a hash containing the information from the last actual error (i.e. only 'fatal' or 'nonfatal' types) stored in the global list
* type = fatal, error, warning, note * message = text message * errorcode = integer error code value
Returns TRUE if the $error object type matches the mask
Returns TRUE if the $error object is either 'fatal' or 'nonfatal'
Returns TRUE if the $error object is 'warning'
Returns TRUE if the $error object is 'note'
Split the error object into component parts and return them in an ARRAY:
[0] = Message [1] = Error code [2] = Type [3] = Parent
Add a new global error handler on to the stack
Last ditch attempt to handle errors. Uses die(), warn() etc as appropriate.
Add a new error to this object instance, also adds the error to this Class list keeping track of all runtime errors
Throws an error for this object based on an error object associated with a different object
Add a new error (type=fatal) to this object instance, also adds the error to this Class list keeping track of all runtime errors
Add a new error (type=nonfatal) to this object instance, also adds the error to this Class list keeping track of all runtime errors
Add a new error (type=warning) to this object instance, also adds the error to this Class list keeping track of all runtime errors
Add a new error (type=note) to this object instance, also adds the error to this Class list keeping track of all runtime errors
Returns a hash containing the information from the last (worst case) error stored for this object i.e. if a 'fatal' error is followed by some 'note's then the 'fatal' error is returned
Returns a hash containing the information from the last actual error (i.e. only 'fatal' or 'nonfatal' types) stored for this object
Returns a hash containing the information from the last error stored for this object
Compares error types. If the type of $err1 is more srious than $err2 then returns positive; if type $err1 is less serious than $err2 then returns negative; otherwise returns 0
Order of seriousness:
* fatal * error * warning * note
Works through the specified errors list and returns the latest, worst error
To install App::Framework, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Framework
CPAN shell
perl -MCPAN -e shell install App::Framework
For more information on module installation, please visit the detailed CPAN module installation guide.