12345678910111213141516171819202122232425262728 |
- class HostsRetrieveError(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(HostsRetrieveError, self).__init__(*args, kwargs)
- class ValidatorError(HostsRetrieveError):
- def __init__(self, reason, code=10001):
- super(ValidatorError, self).__init__(code=code, reason=reason)
- class TaskError(HostsRetrieveError):
- def __init__(self, reason, code=10002):
- super(TaskError, self).__init__(code=code, reason=reason)
- class QccError(HostsRetrieveError):
- def __init__(self, reason, code=10003):
- super(QccError, self).__init__(code=code, reason=reason)
|