diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-05-06 15:17:35 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-05-06 15:17:35 -0400 |
commit | 18555c207db3badfed0909883da871fea0cf3de7 (patch) | |
tree | 8bf6767168f00944582be62fbffb8bf5da0651db /src/rebar_app_discover.erl | |
parent | 5cf005d3a63608ff4a9a7151d8461f360c86cfbb (diff) | |
parent | 291e0de2fe6d637511f3739a1a29004870e09b2e (diff) |
Merge pull request #394 from umbec/master
Manage syntax error in app.src files.
Diffstat (limited to 'src/rebar_app_discover.erl')
-rw-r--r-- | src/rebar_app_discover.erl | 13 |
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([]) -> []; |