Remove the 'try' ... 'catch'

This commit is contained in:
Feng Lee 2019-12-09 11:36:31 +08:00
parent 0c377c67cd
commit cd94ba71b4
1 changed files with 1 additions and 6 deletions

View File

@ -72,7 +72,7 @@ pipeline([], Input, State) ->
{ok, Input, State}; {ok, Input, State};
pipeline([Fun|More], Input, State) -> pipeline([Fun|More], Input, State) ->
try apply_fun(Fun, Input, State) of case apply_fun(Fun, Input, State) of
ok -> pipeline(More, Input, State); ok -> pipeline(More, Input, State);
{ok, NState} -> {ok, NState} ->
pipeline(More, Input, NState); pipeline(More, Input, NState);
@ -82,11 +82,6 @@ pipeline([Fun|More], Input, State) ->
{error, Reason, State}; {error, Reason, State};
{error, Reason, NState} -> {error, Reason, NState} ->
{error, Reason, NState} {error, Reason, NState}
catch
Error:Reason:Stacktrace ->
?LOG(error, "pipeline ~p failed: ~p,\nstacktrace: ~0p",
[{Fun, Input, State}, {Error, Reason}, Stacktrace]),
{error, Reason, State}
end. end.
-compile({inline, [apply_fun/3]}). -compile({inline, [apply_fun/3]}).