mirror of
https://github.com/correl/rebar.git
synced 2024-11-15 03:00:18 +00:00
Improve error logging when running a command fails
Make the error message newline terminated and, if possible, log the name of the module in which the failure occured.
This commit is contained in:
parent
80c065191f
commit
ff5a7982eb
1 changed files with 5 additions and 2 deletions
|
@ -443,8 +443,11 @@ execute(Command, Modules, Config, ModuleFile) ->
|
|||
ok;
|
||||
{error, failed} ->
|
||||
?FAIL;
|
||||
{Module, {error, _} = Other} ->
|
||||
?ABORT("~p failed while processing ~s in module ~s: ~s\n",
|
||||
[Command, Dir, Module, io_lib:print(Other, 1,80,-1)]);
|
||||
Other ->
|
||||
?ABORT("~p failed while processing ~s: ~s",
|
||||
?ABORT("~p failed while processing ~s: ~s\n",
|
||||
[Command, Dir, io_lib:print(Other, 1,80,-1)])
|
||||
end
|
||||
end.
|
||||
|
@ -497,7 +500,7 @@ run_modules([Module | Rest], Command, Config, File) ->
|
|||
ok ->
|
||||
run_modules(Rest, Command, Config, File);
|
||||
{error, _} = Error ->
|
||||
Error
|
||||
{Module, Error}
|
||||
end.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue