Classifies HTTP and body-level exchange responses into Bourse.Error structs.
Extracted from Bourse.HTTP so the transport layer can stay focused on request
execution while error taxonomy (status maps, body sentinels, HTML/geo-block
detection) lives in one place. Behavior-preserving delegation only — the
public HTTP API is unchanged.
Summary
Functions
Classifies an HTTP response into {:ok, response} or {:error, Error.t()}.
Types
@type response() :: %{status: integer(), headers: response_headers(), body: term()}
Normalized success response map
HTTP response headers as returned by Req
Functions
@spec classify_response( atom(), integer(), response_headers(), term(), Bourse.Exchange.t() ) :: {:ok, response()} | {:error, Bourse.Error.t()}
Classifies an HTTP response into {:ok, response} or {:error, Error.t()}.
Handles 2xx body-level errors, non-2xx status normalization, HTML/geo-block and Cloudflare challenge detection. Empty 2xx bodies are successful responses.