diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-05-22 14:34:46 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-05-22 14:34:46 -0400 |
commit | 5f577e2ab15d0aa3b6650f4e3d1ee086be3dc736 (patch) | |
tree | e7ae0873e879bf92ac9f9c51926f34781cab9d16 /src/rebar_otp_app.erl | |
parent | b7acb56f4710fe3fd11163f6874f82f0008625b6 (diff) | |
parent | 476a80c33ee0d835e58eae3b3bb396eae401b9ec (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_otp_app.erl')
-rw-r--r-- | src/rebar_otp_app.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl index c457999..a8c2d62 100644 --- a/src/rebar_otp_app.erl +++ b/src/rebar_otp_app.erl @@ -51,10 +51,10 @@ compile(State, App) -> %% Load the app file and validate it. validate_app(State, App1). -format_error(invalid_app_file) -> - "Failed to read app file"; +format_error({missing_app_file, Filename}) -> + io_lib:format("App file is missing: ~s", [Filename]); format_error({file_read, File, Reason}) -> - io_lib:format("Failed to read ~s for processing: ~p", [File, Reason]); + io_lib:format("Failed to read app file ~s for processing: ~p", [File, file:format_error(Reason)]); format_error({invalid_name, File, AppName}) -> io_lib:format("Invalid ~s: name of application (~p) must match filename.", [File, AppName]). @@ -197,7 +197,7 @@ ensure_registered(AppData) -> consult_app_file(Filename) -> case filelib:is_file(Filename) of false -> - throw(?PRV_ERROR(invalid_app_file)); + {error, enoent}; true -> case lists:suffix(".app.src", Filename) of false -> @@ -214,7 +214,7 @@ app_vsn(AppFile, State) -> Resources = rebar_state:resources(State), rebar_utils:vcs_vsn(get_value(vsn, AppData, AppFile), AppDir, Resources); {error, Reason} -> - ?ABORT("Failed to consult app file ~s: ~p\n", [AppFile, Reason]) + throw(?PRV_ERROR({file_read, AppFile, Reason})) end. get_value(Key, AppInfo, AppFile) -> |