esl/lhttpc — pull request #10 by fdmanana (2012-04-05 13:31:12+00:00)
Title: Simpler error handling for lhttpc users

On error we now always get a response of the form
{error, Reason} instead of either getting such a
response or an exit (which is undocumented).
This simplifies code which wants to deal with all
possible errors, for example:

try
case lhttpc:send_body_part(UploadState, BodyPart, Timeout) of
{ok, UploadState2} ->
loop(UpfateState2, Timeout);
{error, Reason} ->
handle_error(Reason)
end
catch exit:ExitReason ->
handle_error(ExitReason)
end

Would become simply:

case lhttpc:send_body_part(UploadState, BodyPart, Timeout) of
{ok, UploadState2} ->
loop(UpfateState2, Timeout);
{error, Reason} ->
handle_error(Reason)
end