Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
'terminate'/2 callback can change reason
Browse files Browse the repository at this point in the history
  • Loading branch information
pouriya committed Nov 30, 2017
1 parent 5e7aa0c commit be91b16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/director.erl
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ init_it(Starter, Parent, Name0, Mod, InitArg, Opts) ->
case call_terminate(Mod, Data, Rsn0) of
ok ->
Rsn0;
{error, Rsn2} ->
{new_error, Rsn2} ->
Rsn2;
{crash, Rsn2} ->
[Rsn0, Rsn2]
Expand All @@ -920,7 +920,7 @@ init_it(Starter, Parent, Name0, Mod, InitArg, Opts) ->
case call_terminate(Mod, Data, Rsn0) of
ok ->
Rsn0;
{error, Rsn2} ->
{new_error, Rsn2} ->
Rsn2;
{crash, Rsn2} ->
[Rsn0, Rsn2]
Expand Down Expand Up @@ -1987,7 +1987,7 @@ terminate(Dbg
case call_terminate(Mod, Data, Rsn6) of
ok ->
Rsn6;
{error, Rsn8} ->
{new_error, Rsn8} ->
Rsn8;
{crash, Rsn8} ->
Rsn4 ++ [Rsn8]
Expand All @@ -2013,7 +2013,7 @@ terminate(Dbg

call_terminate(Mod, Data, Rsn) ->
try Mod:terminate(Rsn, Data) of
{error, _}=Err ->
{new_error, _}=Err ->
Err;
_ ->
ok
Expand Down

0 comments on commit be91b16

Please sign in to comment.