gamesheet_sdk.common.shared.gamesheet_http module

HTTP response handling utilities.

gamesheet_sdk.common.shared.gamesheet_http.handle_response(response, endpoint, context_msg='request')[source]

Centralized HTTP error handling for all domain modules.

Parameters:
  • response (requests.Response) – The HTTP response object.

  • endpoint (str) – The endpoint that was called.

  • context_msg (str) – Context message for error reporting (e.g., "GET associations").

Raises:
gamesheet_sdk.common.shared.gamesheet_http.check_bff_response_status(data, endpoint)[source]

Validate BFF API response status field.

BFF API responses include a "status" field that should be "success".

Parameters:
  • data (dict[str, Any]) – The parsed JSON response data.

  • endpoint (str) – The endpoint that was called.

Raises:

GameSheetError – If status is not "success".

gamesheet_sdk.common.shared.gamesheet_http.handle_season_scoped_response(response, endpoint, season_id)[source]

Handle HTTP errors for season-scoped API calls.

Provides season-specific error messages for common failures.

Parameters:
  • response (requests.Response) – The HTTP response object.

  • endpoint (str) – The endpoint that was called.

  • season_id (str) – The season ID used in the request.

Raises: