aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-09-11 15:58:51 +0200
committerIngela Anderton Andin <[email protected]>2013-09-13 15:14:06 +0200
commit89f541f6f9d4b90155c2a3b5e81194327810f693 (patch)
treebb58e42b3cf55ae61deaddd522e4191d70de0f53 /lib/inets/src/http_client
parent6189bc07f44a0dbb68dbc65689e049decc0d52e7 (diff)
downloadotp-89f541f6f9d4b90155c2a3b5e81194327810f693.tar.gz
otp-89f541f6f9d4b90155c2a3b5e81194327810f693.tar.bz2
otp-89f541f6f9d4b90155c2a3b5e81194327810f693.zip
httpc: Enhanched error handling
Diffstat (limited to 'lib/inets/src/http_client')
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl11
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;