Skip to content

nos.common.exceptions

nos.common.exceptions

Custom exceptions for the nos client.

ClientException dataclass

Base exception for the nos client.

Source code in nos/common/exceptions.py
@dataclass(frozen=True)
class ClientException(Exception):
    """Base exception for the nos client."""

    message: str
    """Exception message."""
    exc: Exception = None
    """Exception object."""

    def __str__(self) -> str:
        return f"{self.message}"

message instance-attribute

message: str

Exception message.

exc class-attribute instance-attribute

exc: Exception = None

Exception object.

ServerReadyException dataclass

Exception raised when the server is not ready.

Source code in nos/common/exceptions.py
class ServerReadyException(ClientException):
    """Exception raised when the server is not ready."""

    def __str__(self) -> str:
        return f"Server not ready. {self.message}"

InputValidationException dataclass

Exception raised when input validation fails.

Source code in nos/common/exceptions.py
class InputValidationException(ClientException):
    """Exception raised when input validation fails."""

    def __str__(self) -> str:
        return f"Input validation failed. {self.message}"

InferenceException dataclass

Exception raised when inference fails.

Source code in nos/common/exceptions.py
class InferenceException(ClientException):
    """Exception raised when inference fails."""

    def __str__(self) -> str:
        return f"Inference failed. {self.message}"