Modifier and Type | Method and Description |
---|---|
static StackTraceElement[] |
appendStackFrames(Throwable t,
StackTraceElement[] outerFrames)
Prepend stack frames from the current thread onto the given exception's stack frames and return the result.
|
static <T extends Throwable> |
maskException(Throwable t)
Mask a checked exception and throw it as an unchecked exception.
|
static void |
prependCurrentStackTrace(Throwable t)
Prepend stack frames from the current thread onto the given exception's stack frames.
|
public static <T extends Throwable> T maskException(Throwable t) throws T extends Throwable
T
- unchecked exception typet
- any exceptionT
- alwaysT extends Throwable
public static void prependCurrentStackTrace(Throwable t)
This is used to re-throw an exception created in another thread without losing the stack frame information associated with the current thread.
t
- exception from another threadIllegalArgumentException
- if t
is nullpublic static StackTraceElement[] appendStackFrames(Throwable t, StackTraceElement[] outerFrames)
t
- original exceptionouterFrames
- stack frames that should wrap t
's stack framest
's stack frames, followed by outerFrames
IllegalArgumentException
- if t
or outerFrames
is nullCopyright © 2022. All rights reserved.