Package org.jfree.util
Class StackableRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.jfree.util.StackableRuntimeException
-
- All Implemented Interfaces:
java.io.Serializable
public class StackableRuntimeException extends java.lang.RuntimeException
A baseclass for RuntimeExceptions, which could have parent exceptions. These parent exceptions are raised in a subclass and are now wrapped into a subclass of this Exception.The parents are printed when this exception is printed. This class exists mainly for debugging reasons, as with them it is easier to detect the root cause of an error.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Exception
parent
The parent exception.
-
Constructor Summary
Constructors Constructor Description StackableRuntimeException()
Creates a StackableRuntimeException with no message and no parent.StackableRuntimeException(java.lang.String message)
Creates an exception.StackableRuntimeException(java.lang.String message, java.lang.Exception ex)
Creates an exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Exception
getParent()
Returns the parent exception (possibly null).void
printStackTrace(java.io.PrintStream stream)
Prints the stack trace to the specified stream.void
printStackTrace(java.io.PrintWriter writer)
Prints the stack trace to the specified writer.
-
-
-
Constructor Detail
-
StackableRuntimeException
public StackableRuntimeException()
Creates a StackableRuntimeException with no message and no parent.
-
StackableRuntimeException
public StackableRuntimeException(java.lang.String message, java.lang.Exception ex)
Creates an exception.- Parameters:
message
- the exception message.ex
- the parent exception.
-
StackableRuntimeException
public StackableRuntimeException(java.lang.String message)
Creates an exception.- Parameters:
message
- the exception message.
-
-
Method Detail
-
getParent
public java.lang.Exception getParent()
Returns the parent exception (possibly null).- Returns:
- the parent exception.
-
printStackTrace
public void printStackTrace(java.io.PrintStream stream)
Prints the stack trace to the specified stream.- Overrides:
printStackTrace
in classjava.lang.Throwable
- Parameters:
stream
- the output stream.
-
printStackTrace
public void printStackTrace(java.io.PrintWriter writer)
Prints the stack trace to the specified writer.- Overrides:
printStackTrace
in classjava.lang.Throwable
- Parameters:
writer
- the writer.
-
-