-
Notifications
You must be signed in to change notification settings - Fork 98
Implement a stable GuildPass SDK error hierarchy with safe serialisation #449
Copy link
Copy link
Open
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsbackendBackend services, application logic, persistence integration, and server-side functionalityBackend services, application logic, persistence integration, and server-side functionalityerror-handlingError handling improvements and error case management across the codebaseError handling improvements and error case management across the codebaseexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingExpert difficulty tasks requiring deep expertise and architectural decision-makingtype-safetyTypeScript type system improvements and strict type enforcementTypeScript type system improvements and strict type enforcement
Description
Activity
Metadata
Metadata
Assignees
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsbackendBackend services, application logic, persistence integration, and server-side functionalityBackend services, application logic, persistence integration, and server-side functionalityerror-handlingError handling improvements and error case management across the codebaseError handling improvements and error case management across the codebaseexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingExpert difficulty tasks requiring deep expertise and architectural decision-makingtype-safetyTypeScript type system improvements and strict type enforcementTypeScript type system improvements and strict type enforcement
Difficulty: Expert
Type: Feature
Recommended labels (if available in this repo): error-handling, backend, type-safety, expert
Background
A public SDK must give consuming applications reliable ways to distinguish configuration failures, validation failures, transport failures, API failures, and cancellation without depending on fragile error-message matching.
This issue introduces the SDK-wide error contract independently of any specific GuildPass feature.
Problem
The rebuilt SDK does not yet expose a stable error hierarchy or machine-readable error codes.
Future contributors could otherwise create unrelated custom error types, causing an inconsistent public API.
Expected Outcome
Create a small, documented SDK error hierarchy with stable error codes, safe causal chaining, and controlled JSON serialisation.
Suggested Implementation
Introduce a base error such as:
Potential categories may include:
The exact public model should be intentionally small and justified.
The implementation should:
instanceof Errorbehaviour;toJSON;isGuildPassError;Acceptance Criteria
instanceof Errorandinstanceof GuildPassErrorwork correctly.pnpm typecheckpasses.pnpm buildpasses.pnpm testpasses.Likely Affected Files/Directories
Independence Requirement
This issue must define the error model without requiring the transport or configuration issues to be merged first.