QuoteServiceError

public enum QuoteServiceError : Error, Sendable

Errors that can occur when interacting with the Quote Service (SEP-38).

This enum represents all possible error conditions that may arise during quote service operations, including validation errors, HTTP errors, and response parsing failures.

See SEP-38: Quote Service

  • An invalid argument was provided to the service.

    This error occurs when request parameters fail validation before being sent to the server.

    Declaration

    Swift

    case invalidArgument(message: String)

    Parameters

    message

    Description of which argument is invalid and why

  • The server returned a 400 Bad Request response.

    This error occurs when the request is malformed or contains invalid data according to the server.

    Declaration

    Swift

    case badRequest(message: String)

    Parameters

    message

    Error message from the server explaining the bad request

  • The server returned a 403 Forbidden response.

    This error occurs when the client lacks proper authentication or authorization to access the requested resource.

    Declaration

    Swift

    case permissionDenied(message: String)

    Parameters

    message

    Error message from the server explaining the permission denial

  • The server returned a 404 Not Found response.

    This error occurs when the requested quote or resource does not exist.

    Declaration

    Swift

    case notFound(message: String)

    Parameters

    message

    Error message from the server indicating what was not found

  • Failed to parse the response from the server.

    This error occurs when the server returns data in an unexpected format or structure that cannot be decoded into the expected response model.

    Declaration

    Swift

    case parsingResponseFailed(message: String)

    Parameters

    message

    Description of the parsing failure

  • An error occurred during Horizon interaction.

    This error occurs when the underlying Horizon request fails, typically during operations that require on-chain data or transactions.

    Declaration

    Swift

    case horizonError(error: HorizonRequestError)

    Parameters

    error

    The underlying Horizon request error