Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hide http send errors

  • Loading branch information...
commit a7ccf4807a321934d9a69fada59103f580d7fcce 1 parent 24515e3
@gleber authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/mtp.erl
View
16 src/mtp.erl
@@ -206,14 +206,14 @@ http_mtp_encode_and_send(To, From, Message) ->
%% Headers,
%% "multipart/mixed ; boundary=\"251D738450A171593A1583EB\"",
%% HTTPBody}, [], [{sync, true}]),
- HTTPID = gen_server:call(mtp_sender, {http_post, Request}),
- {ok, RequestID} = HTTPID,
- Result = RequestID,
- %%io:format ("Result ~p, ~p~n", [self (), Result]),
- {StatusLine, _ReceivedHeaders, _ReceivedBody} = Result,
- %%io:format ("Status ~w,~s~n", [StatusCode, ReasonPhrase]),
- %%io:format ("Body ~s~n", [ReceivedBody]).
- {_HttpVersion, _StatusCode, _ReasonPhrase} = StatusLine.
+ case gen_server:call(mtp_sender, {http_post, Request}) of
+ {ok, RequestID} ->
+ Result = RequestID,
+ {StatusLine, _ReceivedHeaders, _ReceivedBody} = Result,
+ {_HttpVersion, _StatusCode, _ReasonPhrase} = StatusLine;
+ _ ->
+ ok
+ end.
%%====================================================================
%% Func: init/1
Please sign in to comment.
Something went wrong with that request. Please try again.