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