MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / __init__

Method __init__

src/anthropic/_exceptions.py:81–92  ·  view source on GitHub ↗
(self, message: str, *, response: httpx2.Response, body: object | None)

Source from the content-addressed store, hash-verified

79 workspace_id: str | None
80
81 def __init__(self, message: str, *, response: httpx2.Response, body: object | None) -> None:
82 super().__init__(message, response.request, body=body)
83 self.response = response
84 self.status_code = response.status_code
85 self.request_id = response.headers.get("request-id")
86 self.workspace_id = response.headers.get("anthropic-workspace-id")
87
88 self.type = None
89 if is_dict(body):
90 error = body.get("error")
91 if is_dict(error):
92 self.type = cast(Union[ErrorType, None], error.get("type"))
93
94
95class APIConnectionError(APIError):

Callers

nothing calls this directly

Calls 3

is_dictFunction · 0.85
__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected