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.

  • Tag: AmplifyError
  • A localized message describing what error occurred.

    • Tag: AmplifyError.errorDescription

    Declaration

    Swift

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

    • Tag: AmplifyError.recoverySuggestion

    Declaration

    Swift

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

    • Tag: AmplifyError.underlyingError

    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.

    • Tag: AmplifyError.initWithErrorDescription_recoverySuggestion_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 }