Cartouche.HTTP (Cartouche v0.2.0)

Copy Markdown View Source

HTTP helpers used by cartouche's RPC transports.

Summary

Functions

Normalizes the result of a Finch request.

Functions

normalize_finch_result(finch_result)

@spec normalize_finch_result({:ok, Finch.Response.t()} | {:error, term()}) ::
  {:ok, Finch.Response.t()} | {:error, Finch.Response.t() | String.t()}

Normalizes the result of a Finch request.

Any non-2xx status codes are wrapped in {:error, _}. Other Finch errors abstract away the details of Finch.