log content from http responses that are errors

pull/1/head
Ed Summers 2012-01-17 23:15:24 -05:00
parent 714e45598d
commit 23c3758e84
1 changed files with 6 additions and 2 deletions

View File

@ -57,8 +57,10 @@ def add_by_isbn(isbn, work=None):
if not work or not work.title:
return None
# if there's a work with a title, we want to create stub editions and works, even if google doesn't know about it
# but if it's not valid, forget it!
# if there's a work with a title, we want to create stub editions and
# works, even if google doesn't know about it # but if it's not valid,
# forget it!
try:
isbn=regluit.core.isbn.ISBN(isbn)
except:
@ -343,6 +345,8 @@ def _get_json(url, params={}, type='gb'):
return json.loads(response.content)
else:
logger.error("unexpected HTTP response: %s" % response)
if response.content:
logger.error("response content: %s" % response.content)
raise LookupFailure("GET failed: url=%s and params=%s" % (url, params))