summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mirrored_supervisor.erl14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mirrored_supervisor.erl b/src/mirrored_supervisor.erl
index 221f6a8727..c5f22c517b 100644
--- a/src/mirrored_supervisor.erl
+++ b/src/mirrored_supervisor.erl
@@ -306,9 +306,9 @@ handle_call({init, Overall}, _From,
Delegate = child(Overall, delegate),
erlang:monitor(process, Delegate),
State1 = State#state{overall = Overall, delegate = Delegate},
- case all_started([maybe_start(Group, Delegate, S) || S <- ChildSpecs]) of
- true -> {reply, ok, State1};
- false -> {stop, shutdown, State1}
+ case errors([maybe_start(Group, Delegate, S) || S <- ChildSpecs]) of
+ [] -> {reply, ok, State1};
+ Errors -> {stop, {shutdown, Errors}, State1}
end;
handle_call({start_child, ChildSpec}, _From,
@@ -372,9 +372,9 @@ handle_info({'DOWN', _Ref, process, Pid, _Reason},
[start(Delegate, ChildSpec) || ChildSpec <- ChildSpecs];
_ -> []
end,
- case all_started(R) of
- true -> {noreply, State};
- false -> {stop, shutdown, State}
+ case errors(R) of
+ [] -> {noreply, State};
+ Errors -> {stop, {shutdown, Errors}, State}
end;
handle_info(Info, State) ->
@@ -468,7 +468,7 @@ delete_all(Group) ->
[delete(Group, id(C)) ||
C <- mnesia:select(?TABLE, [{MatchHead, [], ['$1']}])].
-all_started(Results) -> [] =:= [R || R = {error, _} <- Results].
+errors(Results) -> [E || {error, E} <- Results].
%%----------------------------------------------------------------------------