exceptions.py 657 B

123456789101112131415161718192021
  1. # -*- coding: utf-8 -*-
  2. # !/usr/bin/env python
  3. from typing import Optional
  4. from library.jdbase.exceptions import JDException
  5. from library.jdopen import JDOpenErrorCode
  6. class JDOpenValidationError(JDException):
  7. def __init__(self, tips, lvalue, rvalue, client = None):
  8. # type: (basestring, basestring, basestring, Optional[object])->None
  9. super(JDOpenValidationError, self).__init__(
  10. errCode = str(JDOpenErrorCode.MY_VALID_ERROR), errMsg = tips, client = client)
  11. self.lvalue = lvalue
  12. self.rvalue = rvalue
  13. def __repr__(self):
  14. return '{}({} != {})'.format(self.errMsg, self.lvalue, self.rvalue)