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

Function extract_error_code

src/anthropic/_exceptions.py:264–266  ·  view source on GitHub ↗
(body: object)

Source from the content-addressed store, hash-verified

262
263
264def extract_error_code(body: object) -> str | None:
265 error_code = extract_property(body, "error", "details", "error_code")
266 return error_code if isinstance(error_code, str) else None
267
268
269def new_error(error_class: type[AnthropicError], *args: object) -> AnthropicError:

Callers 2

__init__Method · 0.85
make_status_errorFunction · 0.85

Calls 1

extract_propertyFunction · 0.85

Tested by

no test coverage detected