api_24sea.exceptions ==================== .. py:module:: api_24sea.exceptions .. autoapi-nested-parse:: Custom exceptions for the 24SEA API. Exceptions ---------- .. autoapisummary:: api_24sea.exceptions.AuthenticationError api_24sea.exceptions.ProfileError api_24sea.exceptions.DataSignalsError api_24sea.exceptions.HTTPError Functions --------- .. autoapisummary:: api_24sea.exceptions.raise_for_status Module Contents --------------- .. py:exception:: AuthenticationError An exception to raise when the user is not authenticated. .. py:exception:: ProfileError An exception to raise when the user is authenticated, but its profile is not properly configured. .. py:exception:: DataSignalsError An exception to raise when the data signals are not properly configured. .. py:exception:: HTTPError(message: str, text: str = '') Base class for ``RequestError`` and ``HTTPStatusError``. Useful for ``try...except`` blocks when issuing a request, and then calling ``.raise_for_status()``. For example: >>> try: ... response = httpx.get("https://www.example.com") ... response.raise_for_status() ... except httpx.HTTPError as exc: ... print(f"HTTP Exception for {exc.request.url} - {exc}") .. py:function:: raise_for_status(response) -> None Raise an HTTPError if the response status code indicates an error. This function checks the status code of the provided HTTP response. If the status code is in the 4xx or 5xx range, it raises an HTTPError with a descriptive message including the status code and URL. Parameters ---------- response : httpx.Response The HTTP response object to check for errors. Raises ------ HTTPError If the response status code is between 400 and 599 (inclusive), indicating a client or server error.