summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-04-14 11:40:16 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-04-14 11:40:16 +0200
commit424382ed45b4308ebd6100c240a44fc50fcf0fad (patch)
tree85008e24d002a198576936ecf153440dcdc7d5b2
parentdeec60d64e7596b8f886f098ebe5c456a3effab9 (diff)
downloadpykolab-424382ed45b4308ebd6100c240a44fc50fcf0fad.tar.gz
Catch exceptions from modules to prevent from killing the wallace process (#5370)
Summary: Fixes issue where IMAP connection problems would kill wallace (#5370) Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: vanmeeuwen Differential Revision: https://git.kolab.org/D125
-rw-r--r--wallace/modules.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/wallace/modules.py b/wallace/modules.py
index bb09770..babaadf 100644
--- a/wallace/modules.py
+++ b/wallace/modules.py
@@ -114,7 +114,11 @@ def execute(name, *args, **kw):
log.error(_("No such module %r in modules %r (2).") %(name, modules))
sys.exit(1)
- return modules[name]['function'](*args, **kw)
+ try:
+ return modules[name]['function'](*args, **kw)
+ except Exception, errmsg:
+ log.error(_("Unknown error occurred; %r") % (errmsg))
+ log.error("%r" % (traceback.format_exc()))
def heartbeat(name, *args, **kw):
if not modules.has_key(name):