Errors#

exception fitrequest.errors.FitRequestConfigurationError[source]#

Bases: ValueError

Base fitrequest configuration error.

exception fitrequest.errors.FitRequestRuntimeError[source]#

Bases: RuntimeError

Base fitrequest runtime error.

exception fitrequest.errors.UnrecognizedParametersError(method_name: str, unrecognized_arguments: set[str])[source]#

Bases: FitRequestConfigurationError

Unrecognized parameters: the following are neither arguments of the current generated method nor valid httpx.request arguments

method_name: str#
unrecognized_arguments: set[str]#
exception fitrequest.errors.UrlRequestTooLongError(url: str, url_size: int, url_size_limit: int = 4094)[source]#

Bases: FitRequestRuntimeError

Triggered when the length of the requested URL exceeds the maximum allowed limit.

url: str#
url_size: int#
url_size_limit: int = 4094#
exception fitrequest.errors.InvalidMethodDecoratorError(provided_decorator: str)[source]#

Bases: FitRequestConfigurationError

Exception raised when the specified method decorator is either not a valid callable or cannot be retrieved from the global environment using the given name.

provided_decorator: str#
exception fitrequest.errors.UnexpectedNoneBaseURLError[source]#

Bases: FitRequestConfigurationError

Raised when neither MethodConfig nor MethodConfigGroup specifies the base_url attribute.

exception fitrequest.errors.FitDecoratorInvalidUsageError[source]#

Bases: FitRequestConfigurationError

Raised when the @fit decorator is applied to methods that do not belong to a class inheriting from FitRequest.

exception fitrequest.errors.MultipleAuthenticationError[source]#

Bases: FitRequestConfigurationError

Raised when more than one authentication method is detected. The user should provide only a single valid authentication method for the request.

exception fitrequest.errors.HttpVerbNotProvidedError[source]#

Bases: FitRequestConfigurationError

This exception is raised to indicate that a required HTTP verb has not been specified in the MethodConfigFamily configuration. The user should ensure that an appropriate HTTP verb (such as GET, POST, PUT, PATCH, DELETE) is provided.

exception fitrequest.errors.UnexpectedLiteralTypeError(bad_type: type)[source]#

Bases: FitRequestRuntimeError

This exception is raised when an unexpected type is provided instead of a Literal type. During CLI generation, Literal types are converted to Enums to ensure compatibility with the typer library.

bad_type: type#
exception fitrequest.errors.InvalidParamsTypeError(provided_params: Any)[source]#

Bases: FitRequestConfigurationError

Exception raised when the specified parameters have an incorrect type.

provided_params: Any#
exception fitrequest.errors.InvalidResponseTypeError(provided_model: Any)[source]#

Bases: FitRequestConfigurationError

Exception raised when the specified response model have an incorrect type.

provided_model: Any#