summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-04-14 11:39:32 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-04-14 11:39:32 +0200
commit7463f1e43d19d0cb32652f42950d6c60559c8adc (patch)
treea61023f059aa43cece3496ca5545d15189b97283 /wallace
parente817182da578df2523378bf31837e2ed70db9372 (diff)
downloadpykolab-7463f1e43d19d0cb32652f42950d6c60559c8adc.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
Diffstat (limited to 'wallace')
-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):