From 82ee4890ca48d30b38b18b6fe32a1edf041f7a0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Sat, 9 Apr 2011 14:18:38 +0300 Subject: [PATCH] handle 204 return code for subscription request --- feedservice/pubsubhubbub.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/feedservice/pubsubhubbub.py b/feedservice/pubsubhubbub.py index 05ec68e..c5bab34 100644 --- a/feedservice/pubsubhubbub.py +++ b/feedservice/pubsubhubbub.py @@ -166,9 +166,10 @@ class Subscriber(webapp.RequestHandler): try: resp = urllib2.urlopen(huburl, data) except urllib2.HTTPError, e: - msg = 'Could not send subscription to Hub: HTTP Error %d' % e.code - logging.warn(msg) - raise SubscriptionError(msg) + if e.code != 204: # we actually expect a 204 return code + msg = 'Could not send subscription to Hub: HTTP Error %d' % e.code + logging.warn(msg) + raise SubscriptionError(msg) except Exception, e: msg = 'Could not send subscription to Hub: %s' % repr(e) logging.warn(msg) -- 2.11.4.GIT