changeset 2093:917bb59fdbb8

Catch Exception as well, because xmlrpclib lets other exceptions propagate. Also a style fix.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Tue, 05 Jun 2007 00:38:25 +0200
parents 937da10cb5b3
children 9ee68c8b409b
files MoinMoin/events/JabberNotification.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/events/JabberNotification.py	Mon Jun 04 23:31:07 2007 +0200
+++ b/MoinMoin/events/JabberNotification.py	Tue Jun 05 00:38:25 2007 +0200
@@ -23,7 +23,7 @@
     cfg = event.request.cfg
 
     # Check for desired event type and if notification bot is configured
-    if cfg.jabber_enabled is None:
+    if not cfg.jabber_enabled:
         return
     
     # Create an XML RPC server object only if it doesn't exist
@@ -90,5 +90,8 @@
         except xmlrpclib.Error, err:
             print _("XML RPC error: "), str(err)
             return (0, _("Notifications not sent"))
+        except Exception, err:
+            print _("Low-level communication error: "), str(err)
+            return (0, _("Notifications not sent"))
         
     return (1, _("Notifications sent OK"))