Package com.amazon.ion
Class IonException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.amazon.ion.IonException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
_Private_ScalarConversions.ConversionException,ContainedValueException,EmptySymbolException,InvalidSystemSymbolException,NullValueException,ReadOnlyValueException,SubstituteSymbolTableException,UnexpectedEofException,UnknownSymbolException,UnsupportedIonVersionException
public class IonException extends java.lang.RuntimeExceptionBase class for exceptions thrown throughout this library. In most cases, external exceptions (a common example beingIOException) are not propagated directly but are instead wrapped in one or moreIonExceptions.This library does not promise that such an "external cause" will be the direct
causeof the thrown exception: there there may be a chain of multipleIonExceptionbefore getting to the external cause. Here's an example of how to deal with this in a situation where the caller wants to propagateIOExceptions:try { // Call some API } catch (IonException e) { IOException io = e.causeOfType(IOException.class); if (io != null) throw io; throw e; }- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IonException()IonException(java.lang.String message)IonException(java.lang.String message, java.lang.Throwable cause)IonException(java.lang.Throwable cause)Constructs a new exception with the given cause, copying the message from the cause into this instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends java.lang.Throwable>
TcauseOfType(java.lang.Class<T> type)Finds the first exception in theThrowable.getCause()chain that is an instance of the given type.
-
-
-
Constructor Detail
-
IonException
public IonException()
-
IonException
public IonException(java.lang.String message)
-
IonException
public IonException(java.lang.String message, java.lang.Throwable cause)
-
IonException
public IonException(java.lang.Throwable cause)
Constructs a new exception with the given cause, copying the message from the cause into this instance.- Parameters:
cause- the root cause of the exception; must not be null.
-
-