error.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright (c) Twisted Matrix Laboratories.
  2. # See LICENSE for details.
  3. """
  4. Cred errors.
  5. """
  6. from __future__ import division, absolute_import
  7. class Unauthorized(Exception):
  8. """Standard unauthorized error."""
  9. class LoginFailed(Exception):
  10. """
  11. The user's request to log in failed for some reason.
  12. """
  13. class UnauthorizedLogin(LoginFailed, Unauthorized):
  14. """The user was not authorized to log in.
  15. """
  16. class UnhandledCredentials(LoginFailed):
  17. """A type of credentials were passed in with no knowledge of how to check
  18. them. This is a server configuration error - it means that a protocol was
  19. connected to a Portal without a CredentialChecker that can check all of its
  20. potential authentication strategies.
  21. """
  22. class LoginDenied(LoginFailed):
  23. """
  24. The realm rejected this login for some reason.
  25. Examples of reasons this might be raised include an avatar logging in
  26. too frequently, a quota having been fully used, or the overall server
  27. load being too high.
  28. """