aboutsummaryrefslogtreecommitdiffstats
path: root/src/rcl_prv_config.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rcl_prv_config.erl')
-rw-r--r--src/rcl_prv_config.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rcl_prv_config.erl b/src/rcl_prv_config.erl
index 8fb32f2..7a1cd19 100644
--- a/src/rcl_prv_config.erl
+++ b/src/rcl_prv_config.erl
@@ -33,8 +33,9 @@ do(State) ->
lists:foldl(fun load_config/2, {ok, State}, ConfigFiles).
-spec format_error(Reason::term()) -> iolist().
-format_error({consult, Reason}) ->
- file:format_error(Reason);
+format_error({consult, ConfigFile, Reason}) ->
+ io_lib:format("Unable to read file ~s: ~s", [ConfigFile,
+ file:format_error(Reason)]);
format_error({invalid_term, Term}) ->
io_lib:format("Invalid term in config file: ~p", [Term]).
@@ -50,7 +51,7 @@ load_config(ConfigFile, {ok, State}) ->
ok = file:set_cwd(filename:dirname(ConfigFile)),
Result = case file:consult(ConfigFile) of
{error, Reason} ->
- ?RCL_ERROR({consult, Reason});
+ ?RCL_ERROR({consult, ConfigFile, Reason});
{ok, Terms} ->
lists:foldl(fun load_terms/2, {ok, State}, Terms)
end,