ForageError

public struct ForageError : Error, Codable, Equatable

Represents an error that occurs when a request to submit a ForageElement to the Forage API fails.

  • Declaration

    Swift

    public static func == (lhs: ForageError, rhs: ForageError) -> Bool
  • A short string that helps identify the cause of the error. Learn more about SDK error codes

    Example: ‘ebt_error_55’ signifies that a user entered an invalid EBT Card PIN

    Declaration

    Swift

    public let code: String
  • The HTTP status that the Forage API returns in response to the request.

    Declaration

    Swift

    public let httpStatusCode: Int
  • A developer-facing description of the error.

    Declaration

    Swift

    public let message: String
  • Additional details about the error, included for your convenience. Not nil when details are available, e.g. when the error code is ebt_error_51

    Declaration

    Swift

    public let details: ForageErrorDetails?
  • An array of error objects returned from the Forage API.

    Declaration

    Swift

    @available(*, deprecated, message: "Access forageError.code directly instead of unpacking the .errors list")
    public let errors: [ForageErrorObj]