12345678910111213141516171819202122232425262728293031 |
- class ExploreDataError(Exception):
- def __init__(self, *args, **kwargs):
- self.code = kwargs.get('code', 10000)
- self.reason = kwargs.get('reason', '未知的数据挖掘错误,请尽快处理')
- if 'code' not in kwargs:
- kwargs['code'] = self.code
- if 'reason' not in kwargs:
- kwargs['reason'] = self.reason
- [setattr(self, key, val) for key, val in kwargs.items()]
- super(ExploreDataError, self).__init__(*args, kwargs)
- class ValidatorError(ExploreDataError):
- def __init__(self, reason, code=10001):
- super(ValidatorError, self).__init__(code=code, reason=reason)
- class TaskError(ExploreDataError):
- def __init__(self, reason, code=10002):
- super(TaskError, self).__init__(code=code, reason=reason)
- class QccError(ExploreDataError):
- def __init__(self, reason, code=10003):
- super(QccError, self).__init__(code=code, reason=reason)
|