DrBotIRC: improve logging when failing to load a module

This commit is contained in:
Brian S. Stephan 2012-07-26 20:25:55 -05:00
parent 26596e5e00
commit d14ed69916
1 changed files with 4 additions and 2 deletions

View File

@ -453,8 +453,10 @@ class DrBotIRC(irclib.IRC):
self.config.set('dr.botzo', 'module_list', ','.join(modset))
return 'Module ' + modname + ' loaded.'
except ImportError:
return 'Module ' + modname + ' not found.'
except ImportError as e:
self.log.error("Error loading " + modname)
self.log.exception(e)
return "Module '" + modname + "' could not be loaded."
def unload_module(self, modname):
"""Attempt to unload and del a module if it's loaded."""