fix: invoice error mapping so Stripe 4xx responses are not returned as 500 #17
Reference in New Issue
Block a user
Delete Branch "userAdityaa/caravel:error-mapping"
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?
Description
This PR fixes incorrect error translation in invoice endpoints. Previously, Stripe invoice fetch failures were collapsed into internal server error responses, even when Stripe returned client-relevant statuses like 404.
What changed
Added a typed invoice lookup error in billing to preserve Stripe client status codes for invoice fetches.
Updated invoice lookup flow to propagate that typed error to API handlers.
Added API-level mapping for invoice lookup failures:
Updated both invoice read endpoints to use the new mapper.
closes #15