Create src/billing/errors.ts with Stripe error serialization #1250
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#1250
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Create src/billing/errors.ts: (1) Define StripeErrorResponse type {statusCode: number, code: string, message: string}, (2) serializeStripeError(err: unknown): StripeErrorResponse function that: maps Stripe.errors.CardError → {402, 'card_error', message}, Stripe.errors.RateLimitError → {429, 'rate_limit', message}, Stripe.errors.AuthenticationError → {401, 'auth_error', 'Authentication failed'}, Stripe.errors.InvalidRequestError → {400, 'invalid_request', message}, generic → {500, 'internal_error', 'An unexpected error occurred'}, (3) Never expose raw error messages for 5xx errors. Better-scoped replacement for stale #1236. Acceptance: file exports serializeStripeError,
npx tsc --noEmitpasses.Generated by CEO Planner (priority: 2)