Class StackableRuntimeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.pentaho.reporting.libraries.base.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.
- Author:
- Thomas Morgner
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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.StackableRuntimeException
(java.lang.String message, java.lang.Throwable ex) Creates an exception. -
Method Summary
Modifier and TypeMethodDescriptionjava.lang.Exception
Deprecated.use the throwable instead.java.lang.Throwable
void
Prints the stack trace to System.err.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.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
StackableRuntimeException
public StackableRuntimeException()Creates a StackableRuntimeException with no message and no parent. -
StackableRuntimeException
public StackableRuntimeException(java.lang.String message, java.lang.Throwable ex) Creates an exception.- Parameters:
message
- the exception message.ex
- the parent exception.
-
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 Details
-
getParent
public java.lang.Exception getParent()Deprecated.use the throwable instead.Returns the parent exception (possibly null).- Returns:
- the parent exception.
-
getParentThrowable
public java.lang.Throwable getParentThrowable() -
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.
-
printStackTrace
public void printStackTrace()Prints the stack trace to System.err.- Overrides:
printStackTrace
in classjava.lang.Throwable
-