summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-10-28 10:00:00 +0100
committerLoïc Hoguin <[email protected]>2017-10-28 10:00:00 +0100
commit9bedce8c12bc475c066b852248b212ba1d230628 (patch)
treef16d605ecb49dd6aebc449e2d2b46fb61ba5c40d
parent26003f9b9bf707df2b007d706e79fbb046bd9e4f (diff)
downloadct_helper-9bedce8c12bc475c066b852248b212ba1d230628.tar.gz
ct_helper-9bedce8c12bc475c066b852248b212ba1d230628.tar.bz2
ct_helper-9bedce8c12bc475c066b852248b212ba1d230628.zip
Properly ignore Cowboy 2.0 errors
-rw-r--r--src/ct_helper_error_h.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ct_helper_error_h.erl b/src/ct_helper_error_h.erl
index 7e3dc4e..d4cb69e 100644
--- a/src/ct_helper_error_h.erl
+++ b/src/ct_helper_error_h.erl
@@ -86,6 +86,20 @@ handle_event(Event = {error, GL, {emulator, _, Msg}}, State)
{ok, State}
end
end;
+%% Cowboy 2.0.
+handle_event(Event = {error, GL,
+ {_, "Ranch listener" ++ _, [_, _, _, Pid, _, [{M, F, A, _}|_]|_]}},
+ State) when node(GL) =:= node() ->
+ A2 = if is_list(A) -> length(A); true -> A end,
+ Crash = {Pid, M, F, A2},
+ case lists:member(Crash, State) of
+ true ->
+ {ok, lists:delete(Crash, State)};
+ false ->
+ write_event(Event),
+ {ok, State}
+ end;
+%% Cowboy 1.0.
handle_event(Event = {error, GL,
{_, "Ranch listener" ++ _, [_, _, _, Pid, {cowboy_handler, [_, _, _,
{stacktrace, [{M, F, A, _}|_]}|_]}]}},