Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mod_development: show debug message when reloading a module.

  • Loading branch information...
commit fa06227bd652f30717ccaf219bf02d7d5c2680b0 1 parent ce10fb2
@mworrell mworrell authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 modules/mod_development/z_code_reloader.erl
View
10 modules/mod_development/z_code_reloader.erl
@@ -163,10 +163,16 @@ make_all() ->
%% @doc Reload a module, purge the old code.
reload_module(M) ->
+ lager:debug("reloading '~p'", [M]),
code:purge(M),
code:soft_purge(M),
- {module, M} = code:load_file(M),
- {ok, M}.
+ case code:load_file(M) of
+ {module, M} ->
+ {ok, M};
+ {error, Reason} = Error ->
+ lager:warning("Could not reload '~p': ~p", [M, Reason]),
+ Error
+ end.
%% @doc Reload all modules from the zotonic directory or subdirectories. Return a list of modules reloaded. Empty list when nothing changed.
%% @spec reload_loaded_modules() -> [Result]
Please sign in to comment.
Something went wrong with that request. Please try again.