説明なし
選択できるのは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)