Skip to content
Browse files

Updated the list of things that might go wrong when fetching a feed...

  • Loading branch information...
1 parent 9a68d15 commit 07ee7c12cf63012ec1a4a6adf472f905b9c7b587 @jacobian jacobian committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 django_website/aggregator/management/commands/mark_defunct_feeds.py
View
6 django_website/aggregator/management/commands/mark_defunct_feeds.py
@@ -1,5 +1,6 @@
import socket
import urllib2
+import httplib
from django.core.management.base import BaseCommand
from django_website.aggregator.models import Feed
@@ -10,8 +11,9 @@ class Command(BaseCommand):
def handle(self, *args, **kwargs):
for f in Feed.objects.filter(is_defunct=False):
try:
- r = urllib2.urlopen(f.feed_url, timeout=15)
- except (urllib2.HTTPError, urllib2.URLError, socket.timeout), e:
+ urllib2.urlopen(f.feed_url, timeout=15)
+ except (urllib2.HTTPError, urllib2.URLError, httplib.HTTPException,
+ socket.timeout), e:
print "%s on '%s'; marking defunct" % (e, f)
f.is_defunct = True
f.save()

0 comments on commit 07ee7c1

Please sign in to comment.
Something went wrong with that request. Please try again.