AmplifyError

public protocol AmplifyError : CustomDebugStringConvertible, Error

Amplify’s philosophy is to expose friendly error messages to the customer that assist with debugging. Therefore, failable APIs are declared to return error results with Amplify errors, which require recovery suggestions and error messages.

  • A localized message describing what error occurred.

    Declaration

    Swift

    var errorDescription: ErrorDescription { get }
  • A localized message describing how one might recover from the failure.

    Declaration

    Swift

    var recoverySuggestion: RecoverySuggestion { get }
  • The underlying error that caused the error condition

    Declaration

    Swift

    var underlyingError: Error? { get }
  • AmplifyErrors must be able to be initialized from an underlying error. If an AmplifyError is created with this initializer, it must store the underlying error in the underlyingError property so it can be inspected later.

    Implementations of this method should handle the case where error is already an instance of Self, and simply return self as the incoming error.

    Declaration

    Swift

    init(errorDescription: ErrorDescription, recoverySuggestion: RecoverySuggestion, error: Error)
  • debugDescription Extension method

    Declaration

    Swift

    var debugDescription: String { get }
  • isOperationCancelledError Extension method

    Declaration

    Swift

    var isOperationCancelledError: Bool { get }