diff options
Diffstat (limited to 'src/rebar_core.erl')
| -rw-r--r-- | src/rebar_core.erl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl index 7439cff..f097429 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -128,9 +128,17 @@ do([ProviderName | Rest], State) -> {error, Error} catch 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, ProviderName} end. format_error({bad_provider_namespace, {Namespace, Name}}) -> |
