Skip to content

Commit

Permalink
Catch httplib BadStatusLine, log and continue
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Parkes committed Sep 29, 2015
1 parent 3fbb336 commit 32664ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions za_hansard/management/commands/za_hansard_q_and_a_scraper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import httplib
import urllib2
import sys
import re, os
Expand Down Expand Up @@ -268,6 +269,10 @@ def process_answers(self, *args, **options):
self.stderr.write('ERROR URLError while processing %d\n' % row.id)
continue

except httplib.BadStatusLine:
self.stderr.write('ERROR BadStatusLine while processing %d\n' % row.id)
continue

try:
text = question_scraper.extract_answer_text_from_word_document(filename)
row.processed_code = Answer.PROCESSED_OK
Expand Down

0 comments on commit 32664ad

Please sign in to comment.