Current section

Files

Jump to
tallgrass src internal@http@response.erl
Raw

src/internal@http@response.erl

-module(internal@http@response).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([decode/2]).
-spec decode(gleam@http@response:response(binary()), decode:decoder(HRP)) -> {ok,
HRP} |
{error, internal@http@error:error()}.
decode(Response, Decoder) ->
_pipe = erlang:element(4, Response),
_pipe@1 = gleam@json:decode(
_pipe,
fun(_capture) -> decode:from(Decoder, _capture) end
),
gleam@result:replace_error(_pipe@1, decode_error).