1 parent 299f32a commit 8902982Copy full SHA for 8902982
1 file changed
app/controllers/errors.py
@@ -61,6 +61,16 @@ class PayloadTooLarge(DomainError):
61
status_code = 413
62
63
64
+class PaymentRequired(DomainError):
65
+ """The user has exhausted their token/spend budget (402).
66
+
67
+ The billing kill-switch: raised before a cost-incurring run starts
68
+ when the usage ledger shows the user is at or over their allotment.
69
+ """
70
71
+ status_code = 402
72
73
74
class TooManyRequests(DomainError):
75
"""Rate limit exceeded (429).
76
0 commit comments