error.py 567 B

1234567891011121314151617181920212223
  1. class ResourceDepletionError(Exception):
  2. """
  3. 资源枯竭异常,如果从所有抓取网站都抓不到可用的代理资源,
  4. 则抛出此异常。
  5. """
  6. def __init__(self):
  7. Exception.__init__(self)
  8. def __str__(self):
  9. return repr('The proxy source is exhausted')
  10. class PoolEmptyError(Exception):
  11. """
  12. 代理池空异常,如果代理池长时间为空,则抛出此异常。
  13. """
  14. def __init__(self):
  15. Exception.__init__(self)
  16. def __str__(self):
  17. return repr('The proxy pool is empty')