summaryrefslogtreecommitdiff
path: root/src/rebar_prv_app_discovery.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-05-22 14:34:46 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-05-22 14:34:46 -0400
commit5f577e2ab15d0aa3b6650f4e3d1ee086be3dc736 (patch)
treee7ae0873e879bf92ac9f9c51926f34781cab9d16 /src/rebar_prv_app_discovery.erl
parentb7acb56f4710fe3fd11163f6874f82f0008625b6 (diff)
parent476a80c33ee0d835e58eae3b3bb396eae401b9ec (diff)
Merge pull request #470 from tsloughter/master
print and format error message for bad .app files and all bad configs
Diffstat (limited to 'src/rebar_prv_app_discovery.erl')
-rw-r--r--src/rebar_prv_app_discovery.erl11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/rebar_prv_app_discovery.erl b/src/rebar_prv_app_discovery.erl
index 97862c1..0e53bb4 100644
--- a/src/rebar_prv_app_discovery.erl
+++ b/src/rebar_prv_app_discovery.erl
@@ -38,7 +38,7 @@ do(State) ->
State1 = rebar_app_discover:do(State, LibDirs),
{ok, State1}
catch
- throw:{error, Error}->
+ throw:{error, Error} ->
?PRV_ERROR(Error)
end.
@@ -46,12 +46,17 @@ do(State) ->
format_error({multiple_app_files, Files}) ->
io_lib:format("Multiple app files found in one app dir: ~s", [string:join(Files, " and ")]);
format_error({invalid_app_file, File, Reason}) ->
- case Reason of
+ case Reason of
{Line, erl_parse, Description} ->
- io_lib:format("Invalid app file ~s at line ~b: ~p",
+ io_lib:format("Invalid app file ~s at line ~b: ~p",
[File, Line, lists:flatten(Description)]);
_ ->
io_lib:format("Invalid app file ~s: ~p", [File, Reason])
end;
+%% Provide a slightly more informative error message for consult of app file failure
+format_error({rebar_file_utils, {bad_term_file, AppFile, Reason}}) ->
+ io_lib:format("Error in app file ~s: ~s", [rebar_dir:make_relative_path(AppFile,
+ rebar_dir:get_cwd()),
+ file:format_error(Reason)]);
format_error(Reason) ->
io_lib:format("~p", [Reason]).