catch more errors in debug log

This commit is contained in:
j 2016-01-24 14:41:40 +05:30
commit 6b70fa36c7
2 changed files with 7 additions and 3 deletions

View file

@ -52,7 +52,7 @@ def info(key, value):
api_limit.error = True
raise IOError(url, r)
if not 'items' in r:
print('unknown %s: %s [%s]' % (key, value, r))
logger.debug('unknown %s: %s [%s]', key, value, r)
return {}
_data = r['items'][0]['volumeInfo']
_id = r['items'][0]['id']
@ -91,7 +91,7 @@ def info(key, value):
data['isbn'] = []
data['isbn'].append(k['identifier'])
else:
print('unknown identifier', k)
logger.debug('unknown identifier %s', k)
if 'isbn' in data:
data['isbn'] = [to_isbn13(i) for i in data['isbn']][0]