Exceptions
Base Exception
All of the exceptions defined in the library are subclassed from this class.
Warning
Sadly the error’s returned by the API are not documented in any way, so it is recommended to handle this exception where exceptions are being handled in any form. In such case that the exception is stated in the API response, but this exception is raised, please create an issue so a proper exceptions can be implemented.
Authentication Exception
Authentication related exceptions. Exceptions in this section are expected to be raised in a few cases.
The token is structurely invalid (In other words invalidated before a request is even sent.)
The token was rejected by the API.
A new token was requested via the panel (Which means the old token is invalid.)
Note
While it may be obvious, this means the exception could theoretically be raised from any request that is sent to the API.
Authentication related exceptions.
- exception vshieldpy.exceptions.auth_exceptions.InvalidAuthKey(auth_key)
Raised upon finding an invalid format (non base16) auth key, or the key was not accepted by the API.
Idenftifier Exceptions
The exceptions in this section can only be raised from functions that take in an identifier of some sort.
Exceptions for ID related errors.
- exception vshieldpy.exceptions.id_exceptions.InvalidID(msg: str | None = None)
Base class for Invalid ID exceptions.
- exception vshieldpy.exceptions.id_exceptions.InvalidServerID(server_id: str)
Raised when a provided Server ID is invalid.
Parameter Exceptions
Exceptions here are most likely to be raised whilst sending a request to order a server.
General parameter exceptions.
- exception vshieldpy.exceptions.parameter_exceptions.InvalidDays(provided_val: Any, expected_vals: Sequence[int] | str)
Raised if an order, or renewal was attempted with a non-accepted duration in days.
- exception vshieldpy.exceptions.parameter_exceptions.InvalidDuration(msg: str | None = None)
Raised if a non-accepted value is provided for a duration. Intended to be used as a base exception.
- exception vshieldpy.exceptions.parameter_exceptions.InvalidHostname(hostname: str)
Raised if a provided hostname contains non-ascii items, or is longer than 16 characters.
- exception vshieldpy.exceptions.parameter_exceptions.InvalidMonths(provided_val: Any, expected_vals: Sequence[int])
Raised if an order, or renewal was attempted with a non-accepted duration in months.
- exception vshieldpy.exceptions.parameter_exceptions.InvalidParameter(msg: str | None = None)
Raised if an invalid parameter was provided for a request.
Means the API did not respond with any information about the reason of the error beyond being a parameter error.
- exception vshieldpy.exceptions.parameter_exceptions.ReinstallWithoutOS
Raised if a reinstall is requested without specifying an Operating system.