Browse Source

Merge pull request #603 from ferd/display-undefs

Fix reporting of error:undef exceptions
pull/604/head
Tristan Sloughter 10 years ago
parent
commit
39518139d0
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      src/rebar_core.erl

+ 9
- 3
src/rebar_core.erl View File

@ -128,9 +128,15 @@ do([ProviderName | Rest], State) ->
{error, Error} {error, Error}
catch catch
error:undef -> error:undef ->
%% This should really only happen if a plugin provider doesn't export do/1
?DEBUG("Undefined call to provider's do function:~n~p", [erlang:get_stacktrace()]),
?PRV_ERROR({bad_provider_namespace, ProviderName});
Stack = erlang:get_stacktrace(),
case Stack of
[{ProviderName, do, [_], _}|_] ->
%% This should really only happen if a plugin provider doesn't export do/1
?DEBUG("Undefined call to provider's do/1 function:~n~p", [Stack]),
?PRV_ERROR({bad_provider_namespace, ProviderName});
_ -> % re-raise
erlang:raise(error, undef, Stack)
end;
error:{badrecord,provider} -> error:{badrecord,provider} ->
{error, ProviderName} {error, ProviderName}
end. end.

Loading…
Cancel
Save