Commits

Anonymous committed 5b35309

Better error handling in read_trailers/3.

  • Participants
  • Parent commits ce34bcb

Comments (0)

Files changed (1)

src/lhttpc_client.erl

             Hdrs;
         {ok, {http_header, _, Name, _, Value}} ->
             Header = {lhttpc_lib:maybe_atom_to_list(Name), Value},
-            read_trailers(Socket, Ssl, [Header | Hdrs])
+            read_trailers(Socket, Ssl, [Header | Hdrs]);
+        {error, {http_error, Data}} ->
+            throw({bad_trailer, Data})
     end.
 
 read_infinite_body(Socket, {1, 1}, Hdrs, Ssl) ->