暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

exceptions.py 776B

1234567891011121314151617181920212223242526
  1. from lodel import logger
  2. ##@brief Handles common errors on authentication
  3. class AuthenticationError(Exception):
  4. pass
  5. ##@brief Handles authentication error with possible security issue
  6. #
  7. #@note Handle the creation of a security log message containing client info
  8. class AuthenticationSecurityError(AuthenticationError):
  9. def __init__(self, client):
  10. msg = "%s : authentication error" % client
  11. logger.security(msg)
  12. super().__init__(msg)
  13. ##@brief Handles authentication failure
  14. #
  15. #@note Handle the creation of a security log message containing client info
  16. class AuthenticationFailure(Exception):
  17. def __init__(self, client):
  18. msg = "%s : authentication failure" % client
  19. logger.security(msg)
  20. super().__init__(msg)