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:
AuthenticationError – If response status is 401 (Unauthorized) or 403 (Forbidden).
GameSheetError – If response status is 404 or any other >= 400.
- 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:
- 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:
AuthenticationError – If response status is 401 (Unauthorized).
GameSheetError – If response status is 404 or any other >= 400.