diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2016-09-15 09:04:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-15 09:04:09 -0400 |
commit | cba1a1f6d93cdd9c490e594369091e37633fa2c6 (patch) | |
tree | 1b2726396814e7629f8af48de04f90e55d2aeb43 | |
parent | 6a8150e336e9f69b8cf49d62a4c99a3616cf1bf1 (diff) | |
parent | 9ab25aaf1508e4286d755a0a60d6d22728a46dbf (diff) |
Merge pull request #1321 from vans163/error_on_load_file_failure
log error if a module failed to load_file, the user should be aware
-rw-r--r-- | src/rebar_agent.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/rebar_agent.erl b/src/rebar_agent.erl index 8e1c8f6..4b0fc5f 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] + _ -> + ?DEBUG("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} -> + ?DEBUG("Module ~p failed to load because ~p", [M, Error]) + end + end, Modules + ).
\ No newline at end of file |