summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Thompson <andrew@hijacked.us>2010-10-28 00:31:35 -0400
committerAndrew Thompson <andrew@hijacked.us>2010-10-29 11:52:13 -0400
commitff5a7982ebc9fdc8e3103f44c255118d3b26a131 (patch)
treec101f14f4767466441a18bf5ab736503919f3b82 /src
parent80c065191f4a14e6bfe37b8249db01f656c68935 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/rebar_core.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 510732e..e92f158 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -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.