public final class ForeignException extends RuntimeException
Allows foreign exceptions to be caught in guest Java and provides seamless access to the message
and cause. ForeignException can only catch and wrap foreign exceptions.
assert Interop.isException(foreignException);
try {
throw Interop.throwException(foreignException);
} catch (ForeignException e) {
log(e.getClass() + ": " + e.getMessage());
...
throw e;
}
Interop.throwException(Object),
Serialized Form| Modifier and Type | Method and Description |
|---|---|
Throwable |
fillInStackTrace() |
Throwable |
getCause() |
String |
getMessage() |
StackTraceElement[] |
getStackTrace() |
Throwable |
initCause(Throwable cause) |
void |
setStackTrace(StackTraceElement[] stackTrace)
Unsupported,
ForeignException instances are not writable therefore setting the stack
trace has no effect for them. |
addSuppressed, getLocalizedMessage, getSuppressed, printStackTrace, printStackTrace, printStackTrace, toStringpublic String getMessage()
getMessage in class Throwablepublic StackTraceElement[] getStackTrace()
getStackTrace in class Throwablepublic void setStackTrace(StackTraceElement[] stackTrace)
ForeignException instances are not writable therefore setting the stack
trace has no effect for them.setStackTrace in class Throwablepublic Throwable fillInStackTrace()
fillInStackTrace in class Throwable