Skip to content

Improve sdk-lite error handling #5

@Lakes41

Description

@Lakes41

sdk-lite currently throws generic HTTP <status> errors when API requests fail. Add typed errors so frontend and integration clients can handle API failures more reliably.

Suggested tasks

  • Add a GuildPassApiError class
  • Include status code, request path, and safe response message
  • Handle non-JSON error responses
  • Handle empty successful responses safely
  • Add tests for successful responses, API errors, and invalid JSON
  • Update usage documentation if needed

Acceptance criteria

  • API failures throw typed errors
  • Consumers can inspect status code and message
  • Non-JSON and empty responses do not crash unexpectedly
  • Error handling is covered by tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions