Search documentation of Cartouche

# Cartouche.HTTP (Cartouche v0.1.2)

Copy Markdown View Source

HTTP helpers used by cartouche's RPC transports.

## Summary

### Functions

normalize_finch_result(finch_result)

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.