03 Apr 2017 09:00:25 UTC
- Distribution: XML-SAX-Base
- Module version: 1.09
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (3)
- Testers (8416 / 3 / 1)
- KwaliteeBus factor: 1
- 61.67% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity24 month
- Download (27.55KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:2 non-PAUSE usersGRANTM Grant McLean
Take me over?The maintainer of this distribution is looking for someone to take over! If you're interested then please contact them via email.
XML::SAX::Exception - Exception classes for XML::SAX
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
Use them wherever you want, and as much as possible when you encounter such errors. SAX is meant to use exceptions as much as possible to flag problems.
All you need to do to create a new exception class is:
@XML::SAX::Exception::MyException::ISA = ('XML::SAX::Exception')
The given package doesn't need to exist, it'll behave correctly this way. If your exception refines an existing exception class, then you may also inherit from that instead of from the base class.
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.
Module Install Instructions
To install XML::SAX::Base, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install XML::SAX::Base
For more information on module installation, please visit the detailed CPAN module installation guide.