DittoKitError

public enum DittoKitError : Error

All errors that are thrown by the DittoKit SDK are wrapped as a DittoKitError. It 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. If you want a human-readable version of the error then call localizedDescription on the error’s reason.

  • storeError: An error occurred relating to the store.
  • transportError: An error occurred relating to the network transports.
  • identityError: An error occurred relating to the identity.
  • The possible underlying reasons a .storeError error occurs.

    • backendError: An error occurred with the storage backend (LMDB).
    • noIDPresentInDocument: The document did not have an _id when attempting to decode it.
    • nonStringKeyInDocument: The document, represented as a CBOR map, had a key that was not a string.
    • invalidDocumentStructure: The document’s internal representation was invalid.
    • failedToDecodeDocumentData: The document’s data could not be decoded.
    • failedToGetDocumentData: The document’s data at the specified path could not be obtained.
    • failedToDecodeDocumentID: The document’s ID could not be decoded.
    • failedToDecodeDocument: The document could not be decoded.
    • queryCompilationFailed: Compilation of the provided query failed.
    • unexpectedQueryCompilationReturnCode: An unexpected return code was received when compiling the provided query.
    • failedToInitialiseDittoDirectory: The directory that DittoKit attempted to use for its persisted data could not be initialised.
    • invalidLiveQueryID: The live query has not obtained a valid ID.
    • documentNotFound: The document could not be found.
    See more

    Declaration

    Swift

    public enum StoreErrorReason
  • The possible underlying reasons a .transportError error occurs.

    • diagnosticsUnavailable: The request to get transport diagnostics failed.
    • failedToDecodeTransportDiagnostics: Decoding of transport diagnostics data failed.
    See more

    Declaration

    Swift

    public enum TransportErrorReason
  • The possible underlying reasons a .identityError error occurs.

    • unableToClearSiteID: An error occurred when attempting to clear the cached site ID, if one was present.
    See more

    Declaration

    Swift

    public enum IdentityErrorReason
  • Undocumented

    Declaration

    Swift

    case storeError(reason: StoreErrorReason)
  • Undocumented

    Declaration

    Swift

    case transportError(reason: TransportErrorReason)
  • Undocumented

    Declaration

    Swift

    case identityError(reason: IdentityErrorReason)
  • Provides a description of the error.

    Declaration

    Swift

    public var errorDescription: String? { get }