DrBotIRC: improve logging when failing to load a module
This commit is contained in:
parent
26596e5e00
commit
d14ed69916
@ -453,8 +453,10 @@ class DrBotIRC(irclib.IRC):
|
|||||||
self.config.set('dr.botzo', 'module_list', ','.join(modset))
|
self.config.set('dr.botzo', 'module_list', ','.join(modset))
|
||||||
|
|
||||||
return 'Module ' + modname + ' loaded.'
|
return 'Module ' + modname + ' loaded.'
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
return 'Module ' + modname + ' not found.'
|
self.log.error("Error loading " + modname)
|
||||||
|
self.log.exception(e)
|
||||||
|
return "Module '" + modname + "' could not be loaded."
|
||||||
|
|
||||||
def unload_module(self, modname):
|
def unload_module(self, modname):
|
||||||
"""Attempt to unload and del a module if it's loaded."""
|
"""Attempt to unload and del a module if it's loaded."""
|
||||||
|
Loading…
Reference in New Issue
Block a user