diff options
author | Ingela Anderton Andin <[email protected]> | 2013-09-11 15:58:51 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-09-13 15:14:06 +0200 |
commit | 89f541f6f9d4b90155c2a3b5e81194327810f693 (patch) | |
tree | bb58e42b3cf55ae61deaddd522e4191d70de0f53 /lib/inets/src | |
parent | 6189bc07f44a0dbb68dbc65689e049decc0d52e7 (diff) | |
download | otp-89f541f6f9d4b90155c2a3b5e81194327810f693.tar.gz otp-89f541f6f9d4b90155c2a3b5e81194327810f693.tar.bz2 otp-89f541f6f9d4b90155c2a3b5e81194327810f693.zip |
httpc: Enhanched error handling
Diffstat (limited to 'lib/inets/src')
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index f84f37c746..6f45e82eda 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -521,19 +521,12 @@ handle_info({Proto, _Socket, Data}, activate_once(Session), {noreply, State#state{mfa = NewMFA}} catch - exit:_Exit -> - ?hcrd("data processing exit", [{exit, _Exit}]), + _:_Reason -> + ?hcrd("data processing exit", [{exit, _Reason}]), ClientReason = {could_not_parse_as_http, Data}, ClientErrMsg = httpc_response:error(Request, ClientReason), NewState = answer_request(Request, ClientErrMsg, State), - {stop, normal, NewState}; - error:_Error -> - ?hcrd("data processing error", [{error, _Error}]), - ClientReason = {could_not_parse_as_http, Data}, - ClientErrMsg = httpc_response:error(Request, ClientReason), - NewState = answer_request(Request, ClientErrMsg, State), {stop, normal, NewState} - end, ?hcri("data processed", [{final_result, FinalResult}]), FinalResult; |