Package org.apache.commons.jelly.util
Class NestedRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.commons.jelly.util.NestedRuntimeException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
XPathComparator.XPathSortException
public class NestedRuntimeException extends RuntimeException
ARuntimeException
which is nested to preserve stack traces. This class allows the following code to be written to convert a regular Exception into aRuntimeException
without losing the stack trace.try { ... } catch (Exception e) { throw new RuntimeException(e); }
- Version:
- $Revision: 155420 $
- Author:
- James Strachan
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NestedRuntimeException(String msg, Throwable cause)
Constructs a newNestedRuntimeException
with specified detail message and nestedThrowable
.NestedRuntimeException(Throwable cause)
Constructs a newNestedRuntimeException
with specified nestedThrowable
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Throwable
getCause()
void
printStackTrace()
void
printStackTrace(PrintStream out)
void
printStackTrace(PrintWriter out)
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
-
-
-
Constructor Detail
-
NestedRuntimeException
public NestedRuntimeException(Throwable cause)
Constructs a newNestedRuntimeException
with specified nestedThrowable
.- Parameters:
cause
- the exception or error that caused this exception to be thrown
-
-
Method Detail
-
printStackTrace
public void printStackTrace()
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
public void printStackTrace(PrintStream out)
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
public void printStackTrace(PrintWriter out)
- Overrides:
printStackTrace
in classThrowable
-
-