From a1f715115b030124a9c3471f84976a13d9a023b9 Mon Sep 17 00:00:00 2001 From: David Rousselie Date: Tue, 6 Nov 2007 18:55:14 +0100 Subject: [PATCH] Catch exceptions when calling populate_handler darcs-hash:20071106175514-86b55-3e1da59ad7eec5c1ef28f1fe43f9cbe80f40a866.gz --- src/jcl/jabber/component.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/jcl/jabber/component.py b/src/jcl/jabber/component.py index 7c3c929..fc0c717 100644 --- a/src/jcl/jabber/component.py +++ b/src/jcl/jabber/component.py @@ -216,7 +216,14 @@ class AccountManager(object): unicode(from_jid.bare()))) if hasattr(_account, "populate_handler"): - getattr(_account, "populate_handler")() + try: + getattr(_account, "populate_handler")() + except Exception, exception: + type, value, stack = sys.exc_info() + self.__logger.error("Error in timer thread\n%s\n%s" + % (exception, "".join(traceback.format_exception + (type, value, stack, 5)))) + return self.send_error_from_account(_account, exception) if first_account: # component subscribe user presence when registering the first