aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/supervisor_SUITE_data/app_faulty/src/app_faulty.erl
diff options
context:
space:
mode:
authorTomas Pihl <[email protected]>2012-07-22 13:01:43 +0200
committerHenrik Nord <[email protected]>2012-10-05 11:25:06 +0200
commitc2b6342cb57df5925acbacff0aea74358c9a5ffb (patch)
tree26210740332aebc41f66ce304b06033b9b65c50a /lib/stdlib/test/supervisor_SUITE_data/app_faulty/src/app_faulty.erl
parenta24c49aec663f19092cf0d2062af19523666d291 (diff)
downloadotp-c2b6342cb57df5925acbacff0aea74358c9a5ffb.tar.gz
otp-c2b6342cb57df5925acbacff0aea74358c9a5ffb.tar.bz2
otp-c2b6342cb57df5925acbacff0aea74358c9a5ffb.zip
Have supervisor send errors up the chain
If a child fails to start, supervisor relies upon error_logger which does not work when IO is inhibited. Instead pass the error up the chain and let someone else use a proper Reason for any possible printouts.
Diffstat (limited to 'lib/stdlib/test/supervisor_SUITE_data/app_faulty/src/app_faulty.erl')
-rw-r--r--lib/stdlib/test/supervisor_SUITE_data/app_faulty/src/app_faulty.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/stdlib/test/supervisor_SUITE_data/app_faulty/src/app_faulty.erl b/lib/stdlib/test/supervisor_SUITE_data/app_faulty/src/app_faulty.erl
new file mode 100644
index 0000000000..c65b411cd6
--- /dev/null
+++ b/lib/stdlib/test/supervisor_SUITE_data/app_faulty/src/app_faulty.erl
@@ -0,0 +1,17 @@
+-module(app_faulty).
+
+-behaviour(application).
+
+%% Application callbacks
+-export([start/2, stop/1]).
+
+start(_Type, _StartArgs) ->
+ case app_faulty_sup:start_link() of
+ {ok, Pid} ->
+ {ok, Pid};
+ Error ->
+ Error
+ end.
+
+stop(_State) ->
+ ok.