errors.py 474 B

123456789101112131415161718192021
  1. # encoding=utf-8
  2. class ScraperError(Exception):
  3. '''Generic scraper error.'''
  4. class UnhandledStatusCode(ScraperError):
  5. '''The current code does not know what to do with the status code.'''
  6. class UnexpectedNoResult(ScraperError):
  7. '''The code definitely expected a URL but didn't find one.'''
  8. class PleaseRetry(ScraperError):
  9. '''We are banned and should try again later.'''
  10. class MalformedResponse(ScraperError):
  11. '''Server returned garbage data'''