ApiError

public enum ApiError : Error, LocalizedError, @unchecked Sendable

Represents API errors that occur during response transformation.

@unchecked Sendable is used here because the associated [String: Any] JSON dictionary does not conform to Sendable in Swift’s type system. However, this is safe in practice because the dictionary is populated once at the call site during response parsing and is never mutated after the error value is constructed. All access is read-only.

  • An error containing an HTTP status code, a JSON object, and a descriptive message.

    Declaration

    Swift

    case error(Int, [String : Any], String)

    Parameters

    status

    The HTTP status code of the error.

    json

    The JSON data associated with the error.

    message

    A descriptive message explaining the error.

  • Declaration

    Swift

    public var errorDescription: String? { get }