diff options
author | Loïc Hoguin <[email protected]> | 2025-02-08 14:53:15 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2025-02-08 14:53:15 +0100 |
commit | f5b31c3ab5516be169b1873441a12ce7dbc93186 (patch) | |
tree | 5d5de6796360f718c03e8c22038dc16af9a21fc9 | |
parent | 395618eb84cada02875670aec6c3e8f9d923b1f8 (diff) | |
download | ct_helper-master.tar.gz ct_helper-master.tar.bz2 ct_helper-master.zip |
-rw-r--r-- | src/ct_helper_error_h.erl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ct_helper_error_h.erl b/src/ct_helper_error_h.erl index 5d7cf02..3a2f9ea 100644 --- a/src/ct_helper_error_h.erl +++ b/src/ct_helper_error_h.erl @@ -129,6 +129,23 @@ handle_event(Event = {error, GL, write_event(Event), {ok, State} end; +%% Cowboy 2.13+: error coming from Cowboy. +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; +handle_event(Event = {error, GL, + {_, "Ranch listener" ++ _, [_, _, _, _Pid, ct_helper_ignore|_]}}, + State) when node(GL) =:= node() -> + {ok, State}; %% Cowboy 1.0. handle_event(Event = {error, GL, {_, "Ranch listener" ++ _, [_, _, _, Pid, {cowboy_handler, [_, _, _, |