exceptions.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. """
  2. Exceptions used in Rival Regions Wrapper
  3. """
  4. from rival_regions_wrapper import LOGGER
  5. class InvalidLoginMethodException(Exception):
  6. """Raise exception when login method is invalid"""
  7. def __init__(self, *args, **kwargs):
  8. Exception.__init__(self, *args, **kwargs)
  9. LOGGER.warning("Login method invalid")
  10. class RRClientException(Exception):
  11. """RR exception"""
  12. def __init__(self, *args, **kwargs):
  13. Exception.__init__(self, *args, **kwargs)
  14. LOGGER.warning("RRClientException")
  15. class SessionExpireException(Exception):
  16. """Raise when session has expired"""
  17. def __init__(self, *args, **kwargs):
  18. Exception.__init__(self, *args, **kwargs)
  19. LOGGER.warning("Session has expired")
  20. class NoLogginException(Exception):
  21. """Raise exception when client isn't logged in"""
  22. def __init__(self, *args, **kwargs):
  23. Exception.__init__(self, *args, **kwargs)
  24. LOGGER.warning("Not logged in")
  25. class NoCookieException(Exception):
  26. """Raise exception when there is no cookie found"""
  27. def __init__(self, *args, **kwargs):
  28. Exception.__init__(self, *args, **kwargs)
  29. LOGGER.warning("No cookie found")
  30. class NoCaptchaClientException(Exception):
  31. """Raise exception when captcha client is missing"""
  32. def __init__(self, *args, **kwargs):
  33. Exception.__init__(self, *args, **kwargs)
  34. LOGGER.warning("No Captcha client given")
  35. class LoginException(Exception):
  36. """Raise exception when there is an error during login"""
  37. def __init__(self, *args, **kwargs):
  38. Exception.__init__(self, *args, **kwargs)
  39. LOGGER.warning("Error during login")