Package jade.util
Class WrapperException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- jade.util.WrapperException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ContentException,FrameException,ICPException,IMTPException,MTPException,ProfileException,ServiceException,UnreachableException
public abstract class WrapperException extends Exception
This class acts as a base class for all the exceptions that wrap another (nested) exception. The typical usage for descendents of this class is to throw them within thecatchblock for their nested exception.- Version:
- $Date$ $Revision$
- Author:
- Giovanni Rimassa - Universita' di Parma
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWrapperException(String m)Create a wrapper exception with the given message.protectedWrapperException(String m, Throwable t)Create a wrapper exception with the given message and nested exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMessage()Retrieve the exception message text.ThrowablegetNested()Reads the exception wrapped by this object.voidprintStackTrace(PrintStream ps)voidprintStackTrace(PrintWriter pw)Prints the stack trace of this exception.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
WrapperException
protected WrapperException(String m, Throwable t)
Create a wrapper exception with the given message and nested exception.- Parameters:
m- The exception message text.t- The nested exception that caused this one.
-
WrapperException
protected WrapperException(String m)
Create a wrapper exception with the given message.- Parameters:
m- The exception message text.
-
-
Method Detail
-
getMessage
public String getMessage()
Retrieve the exception message text.- Overrides:
getMessagein classThrowable- Returns:
- The exception message, including the nested exception text if present.
-
printStackTrace
public void printStackTrace(PrintWriter pw)
Prints the stack trace of this exception. If a nested exception is present, its stack trace is also printed.- Overrides:
printStackTracein classThrowable
-
printStackTrace
public void printStackTrace(PrintStream ps)
- Overrides:
printStackTracein classThrowable
-
getNested
public Throwable getNested()
Reads the exception wrapped by this object.- Returns:
- the
Throwableobject that is the exception that was originally thrown.
-
-