From 9bedce8c12bc475c066b852248b212ba1d230628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 28 Oct 2017 10:00:00 +0100 Subject: Properly ignore Cowboy 2.0 errors --- src/ct_helper_error_h.erl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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, _}|_]}|_]}]}}, -- cgit v1.2.3