public class IRuntimeException extends java.lang.RuntimeException implements java.io.Serializable, InspectableThrowableI
RuntimeException with better "cause"
handling (also handles TargetException or
CastorPersistenceException for example).
Additionally provides various tools methods for filtering and converting
stacktraces.
Originally introduced to provide Java 1.4 "cause" functionality without
actually requiring Java 1.4.| Constructor and Description |
|---|
IRuntimeException()
Constructs a new `IRuntimeException` with the specified detail message (optional).
|
IRuntimeException(java.lang.String message) |
IRuntimeException(java.lang.String message,
java.lang.Throwable cause)
Constructs a new `IRuntimeException` with the specified detail message and cause.
|
IRuntimeException(java.lang.Throwable cause)
Constructs a new `IRuntimeException` with the specified cause and a detail message of
{@code (cause==null ?
|
| Modifier and Type | Method and Description |
|---|---|
static IRuntimeException |
createFromStackTraceString(java.lang.String str)
Deprecated.
please use {@link #ofStackTraceString(String) instead
|
static void |
dumpJVMStack()
Deprecated.
|
static void |
dumpJVMStack(java.io.PrintStream ps)
Deprecated.
|
static void |
dumpStack()
Deprecated.
|
static void |
dumpStack(java.lang.String msg)
Deprecated.
|
static void |
dumpStack(java.lang.String msg,
java.io.PrintStream ps)
Deprecated.
|
static void |
filterAndDumpStackTrace(java.lang.String str)
Deprecated.
|
IRuntimeException |
filterStackTrace()
non-static version of
filterStackTrace(Throwable) |
static java.lang.Throwable |
filterStackTrace(java.lang.Throwable t)
Deprecated.
|
static java.lang.Throwable[] |
getAllCauses(java.lang.Throwable t)
Deprecated.
|
static java.lang.Throwable |
getCause(java.lang.Throwable t)
Deprecated.
|
static java.lang.String |
getCauseMethod(java.lang.Throwable t)
Deprecated.
|
static java.lang.Throwable |
getCauseOfClass(java.lang.Class clazz,
java.lang.Throwable t)
Deprecated.
|
static java.lang.Throwable |
getDeepestCauseOfClass(java.lang.Class clazz,
java.lang.Throwable t)
Deprecated.
|
static java.lang.String |
getErrortext(java.lang.Exception ex)
Deprecated.
|
static java.lang.String |
getErrortext(java.lang.Exception ex,
java.lang.String msg)
Deprecated.
|
static java.lang.Throwable |
getRootCause(java.lang.Throwable t)
Deprecated.
|
static java.lang.String |
getStackTraceAsString(java.lang.Thread t)
Deprecated.
|
static java.lang.String |
getStackTraceAsString(java.lang.Thread t,
boolean filtered)
Deprecated.
|
static java.lang.String |
getStackTraceAsString(java.lang.Thread t,
OutputConfiguration outputConfig)
Deprecated.
|
static java.lang.String |
getStackTraceAsString(java.lang.Throwable t)
Deprecated.
|
static java.lang.String |
getStackTraceAsString(java.lang.Throwable t,
boolean filtered)
Deprecated.
|
static java.lang.String |
getStackTraceAsString(java.lang.Throwable t,
OutputConfiguration outputConfig)
Deprecated.
|
static java.lang.StackTraceElement |
getStackTraceElement(java.lang.Throwable t,
java.lang.String declaringClass,
java.lang.String methodName)
Deprecated.
|
static java.lang.StackTraceElement |
getStackTraceElement(java.lang.Throwable t,
java.lang.String declaringClass,
java.lang.String methodName,
java.lang.String fileName)
Deprecated.
|
static boolean |
hasCauseOfClass(java.lang.Class clazz,
java.lang.Throwable t)
Deprecated.
|
static boolean |
isKnownWrapperException(java.lang.Throwable t)
Deprecated.
|
static IRuntimeException |
ofStackTraceString(java.lang.String str)
Creates an
IRuntimeException instance from a given stacktrace
string. |
void |
printStackTrace(java.io.PrintStream ps)
Prints stacktrace of this
IRuntimeException to the given
PrintStream, filtering out certain stack frames if requested. |
void |
printStackTrace(java.io.PrintStream ps,
OutputConfiguration outputConfig) |
void |
printStackTrace(java.io.PrintWriter pw)
Prints stacktrace of this
IRuntimeException to the given
PrintWriter, filtering out certain stack frames if requested. |
void |
printStackTrace(java.io.PrintWriter pw,
OutputConfiguration outputConfig) |
static void |
printStackTrace(java.lang.StackTraceElement[] stacktrace,
java.io.PrintWriter pw)
Deprecated.
|
static void |
printStackTrace(java.lang.StackTraceElement[] stacktrace,
java.io.PrintWriter pw,
OutputConfiguration outputConfig)
Deprecated.
|
static void |
printStackTrace(java.lang.StackTraceElement[] stacktrace,
java.io.PrintWriter pw,
OutputConfiguration outputConfig,
int upToFrame)
Deprecated.
|
static void |
printStackTrace(java.lang.StackTraceElement[] stacktrace,
java.io.PrintWriter pw,
OutputConfiguration outputConfig,
int upToFrame,
int fromFrame)
Deprecated.
|
static void |
printStackTrace(java.lang.Throwable t,
boolean filtered)
Deprecated.
|
void |
printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps)
Deprecated.
|
static void |
printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps,
boolean filtered)
Deprecated.
|
void |
printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps,
OutputConfiguration outputConfig)
Deprecated.
|
static void |
printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps,
OutputConfiguration outputConfig,
int upToFrame)
Deprecated.
|
static void |
printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps,
OutputConfiguration outputConfig,
int upToFrame,
int fromFrame)
Deprecated.
|
static void |
printStackTrace(java.lang.Throwable t,
java.io.PrintWriter pw)
Deprecated.
|
static void |
printStackTrace(java.lang.Throwable t,
java.io.PrintWriter pw,
OutputConfiguration outputConfig)
Deprecated.
|
static void |
printStackTrace(java.lang.Throwable t,
java.io.PrintWriter pw,
OutputConfiguration outputConfig,
int upToFrame)
Deprecated.
|
static void |
printStackTrace(java.lang.Throwable t,
java.io.PrintWriter pw,
OutputConfiguration outputConfig,
int upToFrame,
int fromFrame)
Deprecated.
|
static void |
printStackTraceAsCause(java.lang.String cm,
java.lang.Throwable t,
java.io.PrintWriter pw,
java.lang.StackTraceElement[] causedTrace,
OutputConfiguration outputConfig)
Deprecated.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCauseOfClass, getDeepestCauseOfClass, getRootCause, getThisAsThrowable, hasCauseOfClass, printStackTracepublic IRuntimeException(java.lang.Throwable cause)
(cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).
This constructor is useful for runtime exceptions that are little more than wrappers for other throwables.cause - the cause (which is saved for later retrieval by the Throwable.getCause() method).
(A null value is permitted, and indicates that the cause is nonexistent or unknown.)public IRuntimeException()
This constructor allows for the possibility of setting the cause of this exception later using the `initCause()` method, which can be useful in testing scenarios.
**Note:** This constructor was added, as the NetRexx transpiler handles an optional 'cause' parameter
(method IRuntimeException(s = String null, cause = Throwable null) by passing `null`
as 2nd parameter to super, which would prevent calling the `initCause()` method later on.
message - the detail message (which is saved for later retrieval by the Throwable.getMessage() method) (optional).public IRuntimeException(java.lang.String message)
public IRuntimeException(java.lang.String message,
java.lang.Throwable cause)
message - the detail message (which is saved for later retrieval by the Throwable.getMessage() method).cause - the cause (which is saved for later retrieval by the Throwable.getCause() method).
(A null value is permitted, and indicates that the cause is nonexistent or unknown.)public static IRuntimeException ofStackTraceString(java.lang.String str)
IRuntimeException instance from a given stacktrace
string. Mainly for convenience handling of debugging output.str - the stacktrace as a StringIRuntimeException@Deprecated public static java.lang.Throwable getCause(java.lang.Throwable t)
@Deprecated public static java.lang.Throwable[] getAllCauses(java.lang.Throwable t)
@Deprecated public static java.lang.String getCauseMethod(java.lang.Throwable t)
@Deprecated public static java.lang.Throwable getRootCause(java.lang.Throwable t)
@Deprecated
public static boolean hasCauseOfClass(java.lang.Class clazz,
java.lang.Throwable t)
@Deprecated
public static java.lang.Throwable getCauseOfClass(java.lang.Class clazz,
java.lang.Throwable t)
@Deprecated
public static java.lang.Throwable getDeepestCauseOfClass(java.lang.Class clazz,
java.lang.Throwable t)
@Deprecated public static boolean isKnownWrapperException(java.lang.Throwable t)
@Deprecated
public static java.lang.String getStackTraceAsString(java.lang.Throwable t,
boolean filtered)
@Deprecated public static java.lang.String getStackTraceAsString(java.lang.Throwable t)
@Deprecated
public static java.lang.String getStackTraceAsString(java.lang.Throwable t,
OutputConfiguration outputConfig)
@Deprecated
public static java.lang.String getStackTraceAsString(java.lang.Thread t,
boolean filtered)
@Deprecated public static java.lang.String getStackTraceAsString(java.lang.Thread t)
@Deprecated
public static java.lang.String getStackTraceAsString(java.lang.Thread t,
OutputConfiguration outputConfig)
@Deprecated public static void dumpStack()
@Deprecated public static void dumpStack(java.lang.String msg)
@Deprecated
public static void dumpStack(java.lang.String msg,
java.io.PrintStream ps)
@Deprecated public static void dumpJVMStack()
@Deprecated public static void dumpJVMStack(java.io.PrintStream ps)
@Deprecated
public static void printStackTrace(java.lang.Throwable t,
boolean filtered)
@Deprecated
public static void printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps,
boolean filtered)
@Deprecated
public void printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps)
@Deprecated
public void printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps,
OutputConfiguration outputConfig)
@Deprecated
public static void printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps,
OutputConfiguration outputConfig,
int upToFrame)
@Deprecated
public static void printStackTrace(java.lang.Throwable t,
java.io.PrintStream ps,
OutputConfiguration outputConfig,
int upToFrame,
int fromFrame)
@Deprecated
public static void printStackTraceAsCause(java.lang.String cm,
java.lang.Throwable t,
java.io.PrintWriter pw,
java.lang.StackTraceElement[] causedTrace,
OutputConfiguration outputConfig)
@Deprecated
public static void printStackTrace(java.lang.Throwable t,
java.io.PrintWriter pw)
@Deprecated
public static void printStackTrace(java.lang.Throwable t,
java.io.PrintWriter pw,
OutputConfiguration outputConfig)
@Deprecated
public static void printStackTrace(java.lang.Throwable t,
java.io.PrintWriter pw,
OutputConfiguration outputConfig,
int upToFrame)
@Deprecated
public static void printStackTrace(java.lang.Throwable t,
java.io.PrintWriter pw,
OutputConfiguration outputConfig,
int upToFrame,
int fromFrame)
@Deprecated
public static void printStackTrace(java.lang.StackTraceElement[] stacktrace,
java.io.PrintWriter pw)
@Deprecated
public static void printStackTrace(java.lang.StackTraceElement[] stacktrace,
java.io.PrintWriter pw,
OutputConfiguration outputConfig)
@Deprecated
public static void printStackTrace(java.lang.StackTraceElement[] stacktrace,
java.io.PrintWriter pw,
OutputConfiguration outputConfig,
int upToFrame)
@Deprecated
public static void printStackTrace(java.lang.StackTraceElement[] stacktrace,
java.io.PrintWriter pw,
OutputConfiguration outputConfig,
int upToFrame,
int fromFrame)
@Deprecated public static java.lang.Throwable filterStackTrace(java.lang.Throwable t)
@Deprecated
public static java.lang.StackTraceElement getStackTraceElement(java.lang.Throwable t,
java.lang.String declaringClass,
java.lang.String methodName)
@Deprecated
public static java.lang.StackTraceElement getStackTraceElement(java.lang.Throwable t,
java.lang.String declaringClass,
java.lang.String methodName,
java.lang.String fileName)
@Deprecated public static void filterAndDumpStackTrace(java.lang.String str)
@Deprecated public static IRuntimeException createFromStackTraceString(java.lang.String str)
@Deprecated public static java.lang.String getErrortext(java.lang.Exception ex)
@Deprecated
public static java.lang.String getErrortext(java.lang.Exception ex,
java.lang.String msg)
public void printStackTrace(java.io.PrintStream ps)
IRuntimeException to the given
PrintStream, filtering out certain stack frames if requested.printStackTrace in interface InspectableThrowableIprintStackTrace in class java.lang.Throwableps - the PrintStream to print tooutputConfig - a OutputConfiguration to configure text written to spublic void printStackTrace(java.io.PrintStream ps,
OutputConfiguration outputConfig)
printStackTrace in interface InspectableThrowableIpublic void printStackTrace(java.io.PrintWriter pw)
IRuntimeException to the given
PrintWriter, filtering out certain stack frames if requested.printStackTrace in interface InspectableThrowableIprintStackTrace in class java.lang.Throwablepw - the PrintWriter to print tooutputConfig - a OutputConfiguration to configure text written to spublic void printStackTrace(java.io.PrintWriter pw,
OutputConfiguration outputConfig)
printStackTrace in interface InspectableThrowableIpublic IRuntimeException filterStackTrace()
filterStackTrace(Throwable)filterStackTrace in interface InspectableThrowableICopyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.