Section: User Contributed Perl Documentation (3pm)
throw XML::SAX::Exception::NotSupported( Message => "The foo feature is not supported", );
This module is the base class for all SAX Exceptions, those defined in the spec as well as those that one may create for one's own SAX errors.
There are three subclasses included, corresponding to those of the SAX spec:
XML::SAX::Exception::NotSupported XML::SAX::Exception::NotRecognized XML::SAX::Exception::Parse
CREATING NEW EXCEPTION CLASSES
All you need to do to create a new exception class is:
@XML::SAX::Exception::MyException::ISA = ('XML::SAX::Exception')
This is as simple as exemplified in the SYNOPSIS. In fact, there's nothing more to know. All you have to do is:
throw XML::SAX::Exception::MyException( Message => 'Something went wrong' );
and voila, you've thrown an exception which can be caught in an eval block.