MCPcopy
hub / github.com/openai/openai-python / __init__

Method __init__

src/openai/_exceptions.py:128–139  ·  view source on GitHub ↗
(self, *, response: httpx.Response, body: object | None)

Source from the content-addressed store, hash-verified

126 error: Optional[OAuthErrorCode]
127
128 def __init__(self, *, response: httpx.Response, body: object | None) -> None:
129 message = "OAuth authentication error."
130 error = None
131
132 if is_dict(body):
133 error = body.get("error")
134 description = body.get("error_description")
135 if description and isinstance(description, str):
136 message = description
137
138 super().__init__(message, response=response, body=body)
139 self.error = cast(Optional[OAuthErrorCode], error)
140
141
142class PermissionDeniedError(APIStatusError):

Callers

nothing calls this directly

Calls 3

is_dictFunction · 0.50
getMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected