IOException) are not
propagated directly but are instead wrapped in one or more
IonExceptions.
This library does not promise that such an "external cause" will be the
direct cause of the thrown exception: there
there may be a chain of multiple IonException before getting to the
external cause. Here's an example of how to deal with this in a situation
where the caller wants to propagate IOExceptions:
try {
// Call some API
}
catch (IonException e) {
IOException io = e.causeOfType(IOException.class);
if (io != null) throw io;
throw e;
}
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | IonException(Throwable
the root cause of the exception; must not be null. cause)Constructs a new exception with the given cause, copying the message from the cause into this instance. |
| Modifier and Type | Method and Description |
|---|---|
| public <T extends Throwable> T | Returns: null if there's no cause of the given type.Finds the first exception in the |
| pack-priv Throwable | Returns: null if there's no cause that's not anIonException.Finds the first exception in the |
| private <T extends Throwable> void | rethrowCauseOfType(Class<T> type)
Rethrows the first exception in the |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| IonException | back to summary |
|---|---|
| public IonException() | |
| IonException | back to summary |
|---|---|
| public IonException(String message) | |
| IonException | back to summary |
|---|---|
| public IonException(String message, Throwable cause) | |
| IonException | back to summary |
|---|---|
| public IonException(Throwable cause) Constructs a new exception with the given cause, copying the message from the cause into this instance.
| |
| causeOfType | back to summary |
|---|---|
| public <T extends Throwable> T causeOfType(Class<T> type) Finds the first exception in the
| |
| externalCause | back to summary |
|---|---|
| pack-priv Throwable externalCause() Finds the first exception in the
| |
| rethrowCauseOfType | back to summary |
|---|---|
| private <T extends Throwable> void rethrowCauseOfType(Class<T> type) throws Throwable Rethrows the first exception in the
| |