From a11cb946e3fbf988bf15e5e3ae488f1e92d49718 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Tue, 5 Dec 2017 12:54:07 -0800 Subject: [PATCH] Handle OTP 20 gen_server crash when the client pid is dead --- src/error_logger_lager_h.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/error_logger_lager_h.erl b/src/error_logger_lager_h.erl index d9ce633..8245e85 100644 --- a/src/error_logger_lager_h.erl +++ b/src/error_logger_lager_h.erl @@ -181,6 +181,9 @@ log_event(Event, #state{sink=Sink} = State) -> {Reason, Name} = case Args of [N, _Msg, _State, R] -> {R, N}; + [N, _Msg, _State, R, _Client] -> + %% OTP 20 crash reports where the client pid is dead don't include the stacktrace + {R, N}; [N, _Msg, _State, R, _Client, _Stacktrace] -> %% OTP 20 crash reports contain the pid of the client and stacktrace %% TODO do something with them