Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/stripe/oauth_error.py: 84%
22 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
1from __future__ import absolute_import, division, print_function
3import stripe
4from stripe.error import StripeError
7class OAuthError(StripeError):
8 def __init__(
9 self,
10 code,
11 description,
12 http_body=None,
13 http_status=None,
14 json_body=None,
15 headers=None,
16 ):
17 super(OAuthError, self).__init__(
18 description, http_body, http_status, json_body, headers, code
19 )
21 def construct_error_object(self):
22 if self.json_body is None:
23 return None
25 return (
26 stripe.api_resources.error_object.OAuthErrorObject.construct_from(
27 self.json_body, stripe.api_key
28 )
29 )
32class InvalidClientError(OAuthError):
33 pass
36class InvalidGrantError(OAuthError):
37 pass
40class InvalidRequestError(OAuthError):
41 pass
44class InvalidScopeError(OAuthError):
45 pass
48class UnsupportedGrantTypeError(OAuthError):
49 pass
52class UnsupportedResponseTypeError(OAuthError):
53 pass