aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2019-01-31 11:48:02 +0100
committerSiri Hansen <[email protected]>2019-01-31 11:53:55 +0100
commit00edd430ab158c34ac4a344b93cf46cd8d4912b1 (patch)
tree2ee84b2e8dc7acd65f04eae9598041913e5f71e8
parent71e7b98034ac00d9ee5428ed0602646e29851a29 (diff)
downloadotp-00edd430ab158c34ac4a344b93cf46cd8d4912b1.tar.gz
otp-00edd430ab158c34ac4a344b93cf46cd8d4912b1.tar.bz2
otp-00edd430ab158c34ac4a344b93cf46cd8d4912b1.zip
[observer] Don't crash on Log > Toggle Log View
Since Logger was introduced in OTP-21.0, menu choice Log > Toggle Log View in observer would cause a crash unless an error_logger event handler was explicitly installed. This is now corrected.
-rw-r--r--lib/observer/src/observer_wx.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl
index 453e3bdc2d..fe51afa240 100644
--- a/lib/observer/src/observer_wx.erl
+++ b/lib/observer/src/observer_wx.erl
@@ -771,7 +771,11 @@ ensure_sasl_started(Node) ->
ensure_mf_h_handler_used(Node) ->
%% is log_mf_h used ?
- Handlers = rpc:block_call(Node, gen_event, which_handlers, [error_logger]),
+ Handlers =
+ case rpc:block_call(Node, gen_event, which_handlers, [error_logger]) of
+ {badrpc,{'EXIT',noproc}} -> []; % OTP-21+ and no event handler exists
+ Hs -> Hs
+ end,
case lists:any(fun(L)-> L == log_mf_h end, Handlers) of
false -> throw("Error: log_mf_h handler not used in sasl."),
error;