Class DittoException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.ditto.java.DittoException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DittoException.ActivationException,DittoException.AuthenticationException,DittoException.FatalException,DittoException.IoException,DittoException.PresenceException,DittoException.StoreException,DittoException.TransportException,DittoException.UnknownException,DittoException.UnsupportedException,DittoException.ValidationException
public abstract sealed class DittoException
extends Exception
permits DittoException.ActivationException, DittoException.AuthenticationException, DittoException.FatalException, DittoException.IoException, DittoException.PresenceException, DittoException.StoreException, DittoException.TransportException, DittoException.UnknownException, DittoException.UnsupportedException, DittoException.ValidationException
All errors that are thrown by the Ditto SDK are wrapped as a
DittoException.
This type wraps multiple different types of error that each have an associated reason.
You can access more specific information about an error by switching over the error's reason value.
A human-readable version of the error is available via the localizedMessage property of the error's reason.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents an error that occurred during Ditto activation.static interfaceThe possible underlying reasons anDittoException.ActivationExceptionoccurs.static final classRepresents an error that occurred during authentication with Ditto Cloud.static interfaceThe possible underlying reasons anDittoException.AuthenticationExceptionerror occurs.static final classRepresents a fatal error that theDittoinstance cannot recover from.static final classErrors related to IO devices.static interfaceThe possible underlying reasons anDittoException.IoExceptionoccurs.static final classErrors transforming Ditto mesh presence data to or from JSON encoding.static interfaceThe possible underlying reasons aDittoException.PresenceExceptionoccurs.static final classRepresents an error that occurred during database or storage operations.static interfaceThe possible underlying reasons aDittoException.StoreExceptionoccurs.static final classRepresents an error that occurred in the transport layer.static interfaceThe possible underlying reasons aDittoException.TransportExceptionerror occurs.static final classSome not-yet-categorized error occurred.static final classOperation is not supported.static final classRepresents a validation error for data or configuration.static interfaceThe possible underlying reasons aDittoException.ValidationExceptionoccurs. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.ditto.internal.error.InternalDittoErrorReason -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDittoException(com.ditto.internal.error.InternalDittoErrorReason internalReason) -
Method Summary
Modifier and TypeMethodDescriptionA String representation of the error suitable for display.A formatted description of the error.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
internalReason
protected com.ditto.internal.error.InternalDittoErrorReason internalReason
-
-
Constructor Details
-
DittoException
protected DittoException(com.ditto.internal.error.InternalDittoErrorReason internalReason)
-
-
Method Details
-
getMessage
A formatted description of the error. Not all errors have a message. Use the null-safegetLocalizedMessage()if you don't want to have to handle null values.- Overrides:
getMessagein classThrowable
-
getLocalizedMessage
A String representation of the error suitable for display.- Overrides:
getLocalizedMessagein classThrowable
-