Skip to content

NFL Errors

errors

GriddyNFLError dataclass

GriddyNFLError(message, raw_response, body=None)

Bases: SDKError

The base class for all NFL SDK HTTP error responses.

Source code in src/griddy/nfl/errors/griddynflerror.py
def __init__(
    self, message: str, raw_response: httpx.Response, body: Optional[str] = None
):
    """Initialize with a message, raw HTTP response, and optional body text."""
    super().__init__(message, raw_response, body)

GriddyNFLDefaultError dataclass

GriddyNFLDefaultError(message, raw_response, body=None)

Bases: GriddyNFLError

The fallback error class if no more specific error class is matched.

Source code in src/griddy/nfl/errors/griddynfldefaulterror.py
def __init__(
    self, message: str, raw_response: httpx.Response, body: Optional[str] = None
):
    """Initialize with a formatted error message, raw HTTP response, and optional body text."""
    message = format_error_message(message, raw_response, body)
    super().__init__(message, raw_response, body)

NoResponseError dataclass

NoResponseError(message='No response received')

Bases: GriddyError

Error raised when no HTTP response is received from the server.

Inherits from GriddyError so that catching GriddyError will also catch no-response errors.

Source code in src/griddy/core/errors/no_response_error.py
def __init__(self, message: str = "No response received"):
    """Initialize with an optional error message."""
    object.__setattr__(self, "message", message)
    object.__setattr__(self, "status_code", None)
    object.__setattr__(self, "response_data", {})
    Exception.__init__(self, message)

ResponseValidationError dataclass

ResponseValidationError(
    message, raw_response, cause, body=None
)

Bases: GriddyNFLError

Error raised when there is a type mismatch between the response data and the expected Pydantic model.

Source code in src/griddy/nfl/errors/responsevalidationerror.py
def __init__(
    self,
    message: str,
    raw_response: httpx.Response,
    cause: Exception,
    body: Optional[str] = None,
):
    """Initialize with a message, raw HTTP response, causal exception, and optional body text."""
    message = f"{message}: {cause}"
    super().__init__(message, raw_response, body)

cause property

cause

Normally the Pydantic ValidationError