Detect when librarything.com is experiencing high load and give appropriate error message. Fixes #436

This commit is contained in:
Kovid Goyal 2008-01-10 03:16:01 +00:00
parent 0b088b7eac
commit be6ee664c3

View File

@ -225,6 +225,8 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
s = BeautifulSoup(src) s = BeautifulSoup(src)
url = s.find('td', attrs={'class':'left'}) url = s.find('td', attrs={'class':'left'})
if url is None: if url is None:
if s.find('div', attrs={'class':'highloadwarning'}) is not None:
raise Exception('Could not fetch cover as server is experiencing high load. Please try again later.')
raise Exception('ISBN: '+isbn+' not found.') raise Exception('ISBN: '+isbn+' not found.')
url = url.find('img') url = url.find('img')
if url is None: if url is None: