Fault::ErrorHandler - A base error handler class.


Fault documentation  | view source Contained in the Fault distribution.

Index


NAME

Top

 Fault::ErrorHandler - A base error handler class.

SYNOPSIS

Top

 use Fault::ErrorHandler;
 $class_object = Fault::ErrorHandler->new;
 $flg          = Fault::ErrorHandler->warn ($msg);
 $flg          = $class_object->warn       ($msg);
                 Fault::ErrorHandler->die  ($msg);
                 $class_object->die        ($msg);

Inheritance

Top

 Base Class

Description

Top

This Class does not have instance objects, only a single 'Class Object'. It is always referenced under the Class name. This makes it very easy for code at any level or location within a system to send error messages in a predetermined manner. While this particular class is just a cover for Perl warn and die, one could subclass it to do just about anything..

At the moment this class may seem trivial, however the intention is to add code that will detect and use other methods of warn and die, such as Gtk dialog panels, if they are present. I will impliment that when I find my round tuit(*)

* Round tuits were invented by Paula Shubock of CMU in the early 1980's. The first was a yellow circle with a centered calligraphic 'tuit'!

Examples

Top

 use Fault::ErrorHandler;
 my $classobj      = Fault::ErrorHandler->new;
 my $didwarn       = Fault::ErrorHandler->warn ("Dont do that!");
 my $didwarn       = $classobj->warn           ("Stop it!");
                     Fault::ErrorHandler->die  ("ARRRGGH!!!");
                     $classobj->die            ("R.I.P");

Instance Variables

Top

None.

Class Methods

Top

$class_object = Fault::ErrorHandler->new

Generate the ErrorHandler object if it doesn't exist; otherwise just return the existing class object.

$flg = Fault::ErrorHandler->warn ($msg)
$flg = $class_object->warn ($msg)

Issue the specified warning message and return true if successful. If there is no message, it prints "<Null warning message>".

Fault::ErrorHandler->die ($msg)
$class_object->die ($msg)

Issue the specified die message and then commit hari-kari. If there is no message, it prints "<Null warning message>".

Instance Methods

Top

 None.

Private Class Methods

Top

 None.

Private Instance Methods

Top

 None.

Errors and Warnings

Top

 None.

KNOWN BUGS

Top

 See TODO.

SEE ALSO

Top

 None.

AUTHOR

Top

Dale Amon <amon@vnl.com>


Fault documentation  | view source Contained in the Fault distribution.