diff options
author | Tristan Sloughter <t@crashfast.com> | 2014-11-06 17:44:24 -0600 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2014-11-06 17:44:24 -0600 |
commit | 36b8e61a2b6bc86bda20aa595c3cd9d8e702cb12 (patch) | |
tree | bb091e3d41322fdf8d32aa264a91f55b96f84244 /src | |
parent | 8ee32d74f31ac06c3b97496f69c7fd4674752fc6 (diff) |
better handling of error messages
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar3.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index e5d82f9..a61209a 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -52,7 +52,13 @@ main(Args) -> {error, rebar_abort} -> rebar_utils:delayed_halt(1); {error, {Module, Reason}} -> - ?ERROR(Module:format_error(Reason, []), []), + case code:which(Module) of + non_existing -> + ?ERROR("Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace~n", []), + ?DEBUG("Uncaught error: ~p ~p~n", [Module, Reason]); + _ -> + ?ERROR(Module:format_error(Reason, []), []) + end, rebar_utils:delayed_halt(1); {error, Error} when is_list(Error) -> ?ERROR(Error++"~n", []), |