From d14ed69916e4c726b03b416e9acbfc7909b2a6c2 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 26 Jul 2012 20:25:55 -0500 Subject: [PATCH] DrBotIRC: improve logging when failing to load a module --- DrBotIRC.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DrBotIRC.py b/DrBotIRC.py index 292a6e1..150f773 100644 --- a/DrBotIRC.py +++ b/DrBotIRC.py @@ -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."""