summaryrefslogtreecommitdiff
path: root/src/rebar_app_discover.erl
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-05-07 18:36:15 -0500
committerTristan Sloughter <t@crashfast.com>2015-05-07 18:36:15 -0500
commitc7281abb309283011bd2ef9cdf8da54ddd858aa1 (patch)
tree0a1fe31b0cfbb2ee0f3bdfb0fc0c7b3cb6cbc46c /src/rebar_app_discover.erl
parentb3d444ef67f91815d4ac12a393b5e905b01ebcc3 (diff)
parent3edede54e759f8494981bb2e6380b7eee437b7f3 (diff)
Merge branch 'fix_windows_bootstrap' of https://github.com/ingwinlu/rebar3 into ingwinlu-fix_windows_bootstrap
Diffstat (limited to 'src/rebar_app_discover.erl')
-rw-r--r--src/rebar_app_discover.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl
index 41f41f5..73401bc 100644
--- a/src/rebar_app_discover.erl
+++ b/src/rebar_app_discover.erl
@@ -159,7 +159,12 @@ find_app(AppDir, Validate) ->
case Validate of
V when V =:= invalid ; V =:= all ->
AppInfo = create_app_info(AppDir, File),
- {true, rebar_app_info:app_file_src(AppInfo, File)};
+ case AppInfo of
+ {error, Reason} ->
+ throw({error, {invalid_app_file, File, Reason}});
+ _ ->
+ {true, rebar_app_info:app_file_src(AppInfo, File)}
+ end;
valid ->
false
end;
@@ -175,7 +180,7 @@ find_app(AppDir, Validate) ->
app_dir(AppFile) ->
filename:join(rebar_utils:droplast(filename:split(filename:dirname(AppFile)))).
--spec create_app_info(file:name(), file:name()) -> rebar_app_info:t() | error.
+-spec create_app_info(file:name(), file:name()) -> rebar_app_info:t() | {error, term()}.
create_app_info(AppDir, AppFile) ->
case file:consult(AppFile) of
{ok, [{application, AppName, AppDetails}]} ->
@@ -193,8 +198,8 @@ create_app_info(AppDir, AppFile) ->
false
end,
rebar_app_info:dir(rebar_app_info:valid(AppInfo1, Valid), AppDir);
- _ ->
- error
+ {error, Reason} ->
+ {error, Reason}
end.
dedup([]) -> [];