From 50307a6aa995437228cc5c98f4270e95efb90a3f Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 17 Jan 2016 06:25:04 -0500 Subject: Display error message when bad config is loaded If a bad configuration file is submitted to rebar3 shell, display the following error: ===> The configuration file submitted could not be read and will be ignored. And keep going otherwise rather than silently failing. While crash-fast is usually a good mechanism, the shell so far is very tolerant of failures from apps to boot and whatnot, so this feels appropriate. Fixes #1019 --- src/rebar_prv_shell.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl index 824293f..ea759fc 100644 --- a/src/rebar_prv_shell.erl +++ b/src/rebar_prv_shell.erl @@ -325,9 +325,14 @@ reread_config(State) -> no_config -> ok; ConfigList -> - _ = [application:set_env(Application, Key, Val) + try + [application:set_env(Application, Key, Val) || {Application, Items} <- ConfigList, - {Key, Val} <- Items], + {Key, Val} <- Items] + catch _:_ -> + ?ERROR("The configuration file submitted could not be read " + "and will be ignored.", []) + end, ok end. -- cgit v1.1