From 303047140c0fcb3a0b01ecbffa3fe89dbbcd6806 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 19 Sep 2016 15:12:43 +0200 Subject: inets: httpc improve error handling Handler process should exit normal if manager process has been terminated --- lib/inets/src/http_client/httpc_handler.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/inets/src/http_client') diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index d1c52dcc78..5d3993cb36 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -1887,10 +1887,13 @@ update_session(ProfileName, #session{id = SessionId} = Session, Pos, Value) -> httpc_manager:update_session(ProfileName, SessionId, Pos, Value) end catch - error:undef -> % This could happen during code upgrade + error:undef -> %% This could happen during code upgrade Session2 = erlang:setelement(Pos, Session, Value), insert_session(Session2, ProfileName); - T:E -> + error:badarg -> + exit(normal); %% Manager has been shutdown + T:E -> + %% Unexpected this must be an error! Stacktrace = erlang:get_stacktrace(), error_logger:error_msg("Failed updating session: " "~n ProfileName: ~p" -- cgit v1.2.3