Skip to content

Errors

APIKeyNotProvided

Bases: HTTPClientError

Error for API key not provided.

Source code in inference_sdk/http/errors.py
87
88
89
90
class APIKeyNotProvided(HTTPClientError):
    """Error for API key not provided."""

    pass

EncodingError

Bases: HTTPClientError

Error for encoding errors.

Source code in inference_sdk/http/errors.py
93
94
95
96
class EncodingError(HTTPClientError):
    """Error for encoding errors."""

    pass

HTTPCallErrorError

Bases: HTTPClientError

Error for HTTP call errors.

Attributes:

Name Type Description
description str

The description of the error.

status_code int

The status code of the error.

api_message str

The API message of the error.

Source code in inference_sdk/http/errors.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class HTTPCallErrorError(HTTPClientError):
    """Error for HTTP call errors.

    Attributes:
        description: The description of the error.
        status_code: The status code of the error.
        api_message: The API message of the error.
    """

    def __init__(
        self,
        description: str,
        status_code: int,
        api_message: Optional[str],
    ):
        super().__init__(description)
        self.__description = description
        self.__api_message = api_message
        self.__status_code = status_code

    @property
    def description(self) -> str:
        """The description of the error."""
        return self.__description

    @property
    def api_message(self) -> str:
        """The API message of the error."""
        return self.__api_message

    @property
    def status_code(self) -> int:
        """The status code of the error."""
        return self.__status_code

    def __repr__(self) -> str:
        return (
            f"{self.__class__.__name__}("
            f"description='{self.description}', "
            f"api_message='{self.api_message}',"
            f"status_code={self.__status_code})"
        )

    def __str__(self) -> str:
        return self.__repr__()

api_message property

The API message of the error.

description property

The description of the error.

status_code property

The status code of the error.

HTTPClientError

Bases: Exception

Base class for HTTP client errors.

Source code in inference_sdk/http/errors.py
4
5
6
7
class HTTPClientError(Exception):
    """Base class for HTTP client errors."""

    pass

InvalidInputFormatError

Bases: HTTPClientError

Error for invalid input format.

Source code in inference_sdk/http/errors.py
57
58
59
60
class InvalidInputFormatError(HTTPClientError):
    """Error for invalid input format."""

    pass

InvalidModelIdentifier

Bases: HTTPClientError

Error for invalid model identifier.

Source code in inference_sdk/http/errors.py
63
64
65
66
class InvalidModelIdentifier(HTTPClientError):
    """Error for invalid model identifier."""

    pass

InvalidParameterError

Bases: HTTPClientError

Error for invalid parameter.

Source code in inference_sdk/http/errors.py
105
106
107
108
class InvalidParameterError(HTTPClientError):
    """Error for invalid parameter."""

    pass

ModelNotInitializedError

Bases: HTTPClientError

Error for model not initialized.

Source code in inference_sdk/http/errors.py
69
70
71
72
class ModelNotInitializedError(HTTPClientError):
    """Error for model not initialized."""

    pass

ModelNotSelectedError

Bases: HTTPClientError

Error for model not selected.

Source code in inference_sdk/http/errors.py
81
82
83
84
class ModelNotSelectedError(HTTPClientError):
    """Error for model not selected."""

    pass

ModelTaskTypeNotSupportedError

Bases: HTTPClientError

Error for model task type not supported.

Source code in inference_sdk/http/errors.py
75
76
77
78
class ModelTaskTypeNotSupportedError(HTTPClientError):
    """Error for model task type not supported."""

    pass

WrongClientModeError

Bases: HTTPClientError

Error for wrong client mode.

Source code in inference_sdk/http/errors.py
 99
100
101
102
class WrongClientModeError(HTTPClientError):
    """Error for wrong client mode."""

    pass