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

Method __init__

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

Source from the content-addressed store, hash-verified

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