diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ct_helper_error_h.erl | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ct_helper_error_h.erl b/src/ct_helper_error_h.erl index 2cf88c8..5d7cf02 100644 --- a/src/ct_helper_error_h.erl +++ b/src/ct_helper_error_h.erl @@ -58,11 +58,22 @@ handle_event({error_report, _, {_, crash_report, State) -> {ok, State}; %% Ignore emulator reports that are a duplicate of what Ranch gives us. -%% -%% The emulator always sends strings for errors, which makes it very -%% difficult to extract the information we need, hence the regexps. +handle_event(Event = {error, GL, {emulator, "Error in process ~p" ++ _, Args}}, State) + when node(GL) =:= node(), is_list(Args) -> + [Pid, _Node, {_Error, [{Mod, Fun, Arity, _}|_]}] = Args, + Crash = {Pid, Mod, Fun, Arity}, + case lists:member(Crash, State) of + true -> + {ok, lists:delete(Crash, State)}; + false -> + write_event(Event), + {ok, State} + end; +%% The emulator always sends strings for errors in older OTP versions, +%% which makes it very difficult to extract the information we need, +%% hence the regexps. handle_event(Event = {error, GL, {emulator, _, Msg}}, State) - when node(GL) =:= node() -> + when node(GL) =:= node(), is_list(Msg) -> Result = re:run(Msg, "Error in process ([^\s]+).+? with exit value: " ".+?{stacktrace,\\[{([^,]+),([^,]+),(.+)", |