Servlet::Util::Exception - exception base class
eval { Servlet::Util::Exception->throw("oops"); }; if ($@) { warn "caught exception: $@\n"; }
This is a base class for exceptions. It extends Exception::Class::Base. See Exception::Class for a full list of inherited methods.
There is only one exception to the inherited API: tracing is on by default. This means that a stack trace will be created when an exception is thrown. By way of comparison to java.lang.Throwable, it's as if fillInStackTrace() is automatically called inside throw(). To selectively disable tracing for a subclass, do the following:
fillInStackTrace()
throw()
My::Exception::do_trace(0);
Construct an instance with the given error message.
Exceptions are rarely directly constructed. Usually they are constructed and thrown in one call to throw().
Parameters:
the error message
Constructs an instance with the given error essage and then die()s.
die()
Returns the error message.
Returns a short description of the exception, including the stack trace if the exception has been thrown.
These commonly encountered exceptions are provided as utilities.
Thrown to indicate than an I/O exception of some sort has occurred.
Thrown to indicate that a method has been passed an illegal or inappropriate argument.
Thrown to indicate that a method has been invoked at an illegal or inappropriate time.
Thrown to indicate that an index of some sort (such as to an array) is out of range.
Thrown to indicate that undef was used in a case where a value is required.
Thrown to indicate that the chosen character encoding is unsupported by the environment (most commonly encountered during character conversions on byte streams).
Exception::Class
Brian Moseley, bcm@maz.org
To install Servlet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Servlet
CPAN shell
perl -MCPAN -e shell install Servlet
For more information on module installation, please visit the detailed CPAN module installation guide.