-
Notifications
You must be signed in to change notification settings - Fork 2
Implement unified response parser #12
Copy link
Copy link
Open
Labels
GrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignCampaign: Official Campaignarea:httppriority:p1type:feature
Metadata
Metadata
Assignees
Labels
GrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignCampaign: Official Campaignarea:httppriority:p1type:feature
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
All resource methods should go through a single
_parse_response(response)function that handles JSON decoding, success detection, and mapping HTTP error codes to the correct typed exceptions. This prevents per-resource error handling drift.Proposed Steps
_parse_response(response: httpx.Response) -> dictinhttp_client.py.AuthenticationError.InvalidRequestErrorwith field-level errors if present.NotFoundError.RateLimitError.NetworkError(subject to retry).ShadeError("Invalid response from API").Acceptance Criteria
ShadeErrorrather than crashing with a rawJSONDecodeError.errorkey in the body are still treated as errors.