diff options
author | Siri Hansen <[email protected]> | 2018-04-26 15:13:45 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2018-04-26 15:13:45 +0200 |
commit | 87fa7eab402cd93796a66ab648eab75909e17254 (patch) | |
tree | b4edcd70437bbd30da74fb7e50c37674331d60b1 /lib/kernel | |
parent | 992b57ad0a52f7a3ba945cbfaea53ce3ae3c3f5d (diff) | |
download | otp-87fa7eab402cd93796a66ab648eab75909e17254.tar.gz otp-87fa7eab402cd93796a66ab648eab75909e17254.tar.bz2 otp-87fa7eab402cd93796a66ab648eab75909e17254.zip |
Catch badarg in logger:get_format_depth/0
This env var lookup may fail during termination, when
application_controller process has terminated before logger.
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/src/logger.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl index 7606912da4..943ef8c2d1 100644 --- a/lib/kernel/src/logger.erl +++ b/lib/kernel/src/logger.erl @@ -621,9 +621,13 @@ get_type_config(Type) -> -spec limit_term(term()) -> term(). limit_term(Term) -> - case get_format_depth() of + try get_format_depth() of unlimited -> Term; D -> io_lib:limit_term(Term, D) + catch error:badarg -> + %% This could happen during system termination, after + %% application_controller process is dead. + unlimited end. -spec get_format_depth() -> 'unlimited' | pos_integer(). |