Catch exception during module loading: just skip the module registration

This commit is contained in:
nemunaire 2015-06-02 22:24:45 +02:00
commit c1858fff3a
3 changed files with 15 additions and 12 deletions

View file

@ -117,7 +117,12 @@ def load_file(filename, context):
for mod in config.getNodes("module"):
context.modules_configuration[mod["name"]] = mod
if get_boolean(mod, "autoload", default=True):
__import__(mod["name"])
try:
__import__(mod["name"])
except:
logger.exception("Exception occurs when loading module"
" '%s'", mod["name"])
# Load files asked by the configuration file
for load in config.getNodes("include"):