Permalink
Browse files

Handle the http_error return from decode packet.

(thank you dialyzer)
  • Loading branch information...
oscarh committed Sep 13, 2011
1 parent e243dcf commit 5a906f6e2d6b60ae63787ce0cf532440236c0083
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/lhttpc_client.erl
View
@@ -564,6 +564,8 @@ read_trailers(Socket, Ssl, Trailers, Hdrs, Buffer) ->
read_trailers(Socket, Ssl, NTrailers, NHeaders, NextBuffer);
{ok, http_eoh, _} ->
{Trailers, Hdrs};
+ {ok, {http_error, HttpString}, _} ->
+ erlang:error({bad_trailer, HttpString});
{more, _} ->
case lhttpc_sock:recv(Socket, Ssl) of
{ok, Data} ->
@@ -574,8 +576,6 @@ read_trailers(Socket, Ssl, Trailers, Hdrs, Buffer) ->
{error, Error} ->
erlang:error(Error)
end;
- {http_error, Data} ->
- erlang:error({bad_trailer, Data});
{error, Reason} ->
erlang:error({bad_trailer, Reason})
end.

0 comments on commit 5a906f6

Please sign in to comment.