123456789101112131415161718192021222324252627282930313233 |
- class YbwCrawlError(Exception):
- def __init__(self, *args, **kwargs):
- if 'code' not in kwargs and 'reason' not in kwargs:
- kwargs['code'] = 10000
- kwargs['reason'] = '元博网采集未知错误,请手动处理'
- for key, val in kwargs.items():
- setattr(self, key, val)
- super(YbwCrawlError, self).__init__(*args, kwargs)
- class AccountError(YbwCrawlError):
- def __init__(self, reason='账号异常', code=10001, **kwargs):
- super(AccountError, self).__init__(code=code, reason=reason, **kwargs)
- class CheckError(YbwCrawlError):
- def __init__(self, reason='数据检查异常', code=10002, **kwargs):
- super(CheckError, self).__init__(code=code, reason=reason, **kwargs)
- class CrawlError(YbwCrawlError):
- def __init__(self, reason='数据采集异常', code=10003, **kwargs):
- super(CrawlError, self).__init__(code=code, reason=reason, **kwargs)
- class AttachmentError(YbwCrawlError):
- def __init__(self, reason='附件异常', code=10004, **kwargs):
- super(AttachmentError, self).__init__(code=code, reason=reason, **kwargs)
|