From 04589cf963028c75abd531892b1dcc54dae621b3 Mon Sep 17 00:00:00 2001 From: vans163 Date: Sat, 3 Sep 2016 10:35:26 -0400 Subject: log error if a module failed to load_file, the user should be aware --- src/rebar_agent.erl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rebar_agent.erl b/src/rebar_agent.erl index 8e1c8f6..2d83683 100644 --- a/src/rebar_agent.erl +++ b/src/rebar_agent.erl @@ -142,7 +142,9 @@ reload_modules(Modules, true) -> on_load_not_allowed -> reload_modules([ModError], false), [ModError|Acc]; - _ -> [ModError|Acc] + _ -> + ?ERROR("Module ~p failed to atomic load because ~p", [ModError, Error]), + [ModError|Acc] end end, [], ModRsns @@ -152,4 +154,13 @@ reload_modules(Modules, true) -> %% Older versions, use a more ad-hoc mechanism. reload_modules(Modules, false) -> - [begin code:delete(M), code:purge(M), code:load_file(M) end || M <- Modules]. + lists:foreach(fun(M) -> + code:delete(M), + code:purge(M), + case code:load_file(M) of + {module, M} -> ok; + {error, Error} -> + ?ERROR("Module ~p failed to load because ~p", [M, Error]) + end + end, Modules + ). \ No newline at end of file -- cgit v1.1