Commit f26349e
committed
fix(billing): address review nits — 402 catch-all + null-check consistency
- 402 catch-all in requireQuota middleware no longer surfaces
err.message verbatim. The service only throws known types today
(PAYMENT_PAST_DUE / METER_EXHAUSTED) which are mapped explicitly
above; an unknown 402 sub-type added later would leak the message.
Send a generic "Payment required" phrase instead — new sub-types
must be mapped explicitly above the catch-all.
- billing.quota.service.js: normalize the null-check style on the
active plan lookup. Both branches treat "plan not configured" the
same way; pick the !activePlan shape to match the freePlan branch
above.
All 1666 billing unit tests pass.1 parent e09ac2c commit f26349e
2 files changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
0 commit comments