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

Function extract_error_code

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

Source from the content-addressed store, hash-verified

260
261
262def extract_error_code(body: object) -> str | None:
263 error_code = extract_property(body, "error", "details", "error_code")
264 return error_code if isinstance(error_code, str) else None
265
266
267def 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