DittoKitError

public enum DittoKitError : Error
extension DittoKitError: LocalizedError

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.
  • The possible underlying reasons a .storeError error occurs.

    • backendError: An error occurred with the storage backend (LMDB).
    • documentContentEncodingFailed: The provided document content failed to be encoded.
    • failedToDecodeDocumentID: The document’s ID could not be decoded.
    • 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.
    • failedToDecodeDocument: The document could not be decoded.
    • documentNotFound: The document could not be found.
    • attachmentDataRetrievalError: The attachment data failed to be retrieved.
    • attachmentFileCopyError: The attachment file failed to be copied.
    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
  • Undocumented

    Declaration

    Swift

    case storeError(reason: StoreErrorReason)
  • Undocumented

    Declaration

    Swift

    case transportError(reason: TransportErrorReason)
  • Provides a description of the error.

    Declaration

    Swift

    public var errorDescription: String? { get }