This repository has been archived on 2024-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
python-aternos/python_aternos/aterrors.py

62 lines
1.3 KiB
Python
Raw Normal View History

2021-10-08 18:35:20 +03:00
class AternosError(Exception):
2022-06-16 14:40:10 +03:00
2022-06-23 14:13:56 +03:00
"""Common error class"""
2021-10-08 18:35:20 +03:00
2022-04-28 08:23:02 +03:00
class CloudflareError(AternosError):
2022-06-23 14:13:56 +03:00
"""Raised when the parser is unable
to bypass Cloudflare protection"""
2022-04-28 08:23:02 +03:00
2022-03-18 17:38:36 +03:00
class CredentialsError(AternosError):
2022-06-23 14:13:56 +03:00
"""Raised when a session cookie is empty
which means incorrect credentials"""
2022-06-16 14:40:10 +03:00
class TokenError(AternosError):
2022-06-23 14:13:56 +03:00
"""Raised when the parser is unable
to extract Aternos ajax token"""
2021-10-08 18:35:20 +03:00
2022-03-18 17:38:36 +03:00
class ServerError(AternosError):
2022-06-23 14:13:56 +03:00
"""Common class for server errors"""
2022-06-16 14:40:10 +03:00
class ServerEulaError(ServerError):
2022-06-23 14:13:56 +03:00
"""Raised when trying to start without
confirming Mojang EULA"""
2022-06-16 14:40:10 +03:00
class ServerRunningError(ServerError):
2022-06-23 14:13:56 +03:00
"""Raised when trying to start
already running server"""
2022-06-16 14:40:10 +03:00
class ServerSoftwareError(ServerError):
2022-06-23 14:13:56 +03:00
"""Raised when Aternos notifies about
incorrect software version"""
2022-06-16 14:40:10 +03:00
class ServerStorageError(ServerError):
2022-06-23 14:13:56 +03:00
"""Raised when Aternos notifies about
violation of storage limits (4 GB for now)"""
2022-03-18 17:38:36 +03:00
class FileError(AternosError):
2022-06-23 14:13:56 +03:00
"""Raised when trying to execute a disallowed
by Aternos file operation"""
2022-07-01 04:47:19 +03:00
class PermissionError(AternosError):
"""Raised when trying to execute a non-allowed
command on a server (Think friends permissions)"""