aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorbell <bell@mad-felix.(none)>2013-12-22 03:18:08 +0400
committerHenrik Nord <[email protected]>2014-02-14 15:57:26 +0100
commit6fff160604ccf60fa8682387d66f3d631c6e9030 (patch)
treed74d0d455ce0eb4358821d474bd18613aaf4af08 /lib/stdlib/src
parent25237481ccccd3ddfa74582dc267632ad618ba30 (diff)
downloadotp-6fff160604ccf60fa8682387d66f3d631c6e9030.tar.gz
otp-6fff160604ccf60fa8682387d66f3d631c6e9030.tar.bz2
otp-6fff160604ccf60fa8682387d66f3d631c6e9030.zip
Suppress error report when child was terminated normally
Description: Let's assume we have a supervisor_bridge as a non-permanent child of a supervisor. When the bridge terminates normally it reports by error_logger:error_report, but the supervisor does nothing. So we have tons (especially, when it's simple_one_for_one) of error messages while everything is completely ok. Let's assume we have a supervisor_bridge as a permanent child of a supervisor. When the bridge terminates, it invokes error_logger, but what for? The supervisor will invoke error_logger about this error right after that. So what is the reason for the error_logger to log for normally terminating children in this case?
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/supervisor_bridge.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/stdlib/src/supervisor_bridge.erl b/lib/stdlib/src/supervisor_bridge.erl
index e8405ab9a4..ff4502f0b9 100644
--- a/lib/stdlib/src/supervisor_bridge.erl
+++ b/lib/stdlib/src/supervisor_bridge.erl
@@ -101,7 +101,16 @@ handle_cast(_, State) ->
{noreply, State}.
handle_info({'EXIT', Pid, Reason}, State) when State#state.pid =:= Pid ->
- report_error(child_terminated, Reason, State),
+ case Reason of
+ normal ->
+ ok;
+ shutdown ->
+ ok;
+ {shutdown, _Term} ->
+ ok;
+ _ ->
+ report_error(child_terminated, Reason, State)
+ end,
{stop, Reason, State#state{pid = undefined}};
handle_info(_, State) ->
{noreply, State}.