浏览代码

better handling of error messages

pull/3/head
Tristan Sloughter 10 年前
父节点
当前提交
36b8e61a2b
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. +7
    -1
      src/rebar3.erl

+ 7
- 1
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", []),

正在加载...
取消
保存