summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-02-02 18:24:24 -0600
committerTristan Sloughter <t@crashfast.com>2015-02-02 18:24:24 -0600
commitc8d0aa46c40832fcc5c0ae6d8ea2c8fd67c53690 (patch)
tree7d09e4c1c90506717fc210ddc01fe6e7c05f464d
parent6ad9200d795c356fad839e13180efe2f511f471b (diff)
clean up create_logic_providers function
-rw-r--r--src/rebar_state.erl18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl
index 42caa5b..29b7c3f 100644
--- a/src/rebar_state.erl
+++ b/src/rebar_state.erl
@@ -278,8 +278,8 @@ add_provider(State=#state_t{providers=Providers}, Provider) ->
State#state_t{providers=[Provider | Providers]}.
create_logic_providers(ProviderModules, State0) ->
- State1 = try
- lists:foldl(fun(ProviderMod, StateAcc) ->
+ try
+ State1 = lists:foldl(fun(ProviderMod, StateAcc) ->
case providers:new(ProviderMod, StateAcc) of
{error, Reason} ->
?ERROR(Reason++"~n", []),
@@ -287,13 +287,13 @@ create_logic_providers(ProviderModules, State0) ->
{ok, StateAcc1} ->
StateAcc1
end
- end, State0, ProviderModules)
- catch
- C:T ->
- ?DEBUG("~p: ~p ~p", [C, T, erlang:get_stacktrace()]),
- throw({error, "Failed creating providers. Run with DEBUG=1 for stacktrace."})
- end,
- apply_hooks(State1).
+ end, State0, ProviderModules),
+ apply_hooks(State1)
+ catch
+ C:T ->
+ ?DEBUG("~p: ~p ~p", [C, T, erlang:get_stacktrace()]),
+ throw({error, "Failed creating providers. Run with DEBUG=1 for stacktrace."})
+ end.
apply_hooks(State0) ->
try