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
Servlet::Util::Exception(3) User Contributed Perl Documentation Servlet::Util::Exception(3)

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:

  My::Exception::do_trace(0);

new($msg)
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:

$msg
the error message

throw($msg)
Constructs an instance with the given error essage and then "die()"s.

Parameters:

$msg
the error message

getMessage()
Returns the error message.
toString()
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.
Servlet::Util::IOException
Thrown to indicate than an I/O exception of some sort has occurred.
Servlet::Util::IllegalArgumentException
Thrown to indicate that a method has been passed an illegal or inappropriate argument.
Servlet::Util::IllegalStateException
Thrown to indicate that a method has been invoked at an illegal or inappropriate time.
Servlet::Util::IndexOutOfBoundsException
Thrown to indicate that an index of some sort (such as to an array) is out of range.
Servlet::Util::UndefReferenceException
Thrown to indicate that undef was used in a case where a value is required.
Servlet::Util::UnsupportedEncodingException
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
2001-07-13 perl v5.32.1

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

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