XML::SA...xception(3)
π NAME π
okay so bestie, welcome to the XML::SA...xception(3) page β it's part of the User Contributed Perl Documentation, and the module is XML::SAX::Exception β Exception classes for XML::SAX. π
β¨
β¨ SYNOPSIS β¨
throw XML::SAX::Exception::NotSupported(
Message => "The foo feature is not supported",
);
π¦ DESCRIPTION π¦
This module is the base class for all SAX Exceptions β both the ones defined in the spec and the ones you might create for your own SAX errors. lowkey iconic. π«Ά
There are three subclasses included, and they correspond to those of the SAX spec:
XML::SAX::Exception::NotSupportedXML::SAX::Exception::NotRecognizedXML::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. no cap. β¨
π CREATING NEW EXCEPTION CLASSES π
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. slay. π
π₯ THROWING EXCEPTIONS π₯
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. periodt. π
cute lil sign-off: this page is from the User Contributed Perl Documentation, perl v5.42.0, dated 2017-04-04, and the manual name is XML::SA...xception(3). mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-XML-SAX-Base 1.09-160000.2.2 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms