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))
|
||||
|
||||
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."""
|
||||
|
Loading…
Reference in New Issue
Block a user