GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XML::SAX::EXCEPTION (3)

.ds Aq ’

NAME

XML::SAX::Exception - Exception classes for XML::SAX

CONTENTS

SYNOPSIS



  throw XML::SAX::Exception::NotSupported(
          Message => "The foo feature is not supported",
          );



DESCRIPTION

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.

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.

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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 XML::SAX::EXCEPTION (3) 2011-09-14

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.