2018-08-06 23:07:26 +02:00
|
|
|
from typing import Any, Dict
|
|
|
|
|
|
|
|
# List of StripeError's from https://stripe.com/docs/api/python#error_handling
|
|
|
|
|
2018-07-24 15:16:50 +02:00
|
|
|
class StripeError(Exception):
|
|
|
|
http_status: str
|
2018-08-06 23:07:26 +02:00
|
|
|
json_body: Dict[str, Any]
|
2018-07-24 15:16:50 +02:00
|
|
|
|
2018-08-06 23:07:26 +02:00
|
|
|
class CardError(StripeError):
|
|
|
|
...
|
|
|
|
|
|
|
|
class RateLimitError(StripeError):
|
|
|
|
...
|
|
|
|
|
|
|
|
class InvalidRequestError(StripeError):
|
|
|
|
...
|
|
|
|
|
|
|
|
class AuthenticationError(StripeError):
|
|
|
|
...
|
2018-07-24 15:16:50 +02:00
|
|
|
|
2018-08-06 23:07:26 +02:00
|
|
|
class APIConnectionError(StripeError):
|
2018-07-24 15:16:50 +02:00
|
|
|
...
|