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

Function api_error_response

tests/lib/threads/helpers.py:766–772  ·  view source on GitHub ↗
(
    status: int, error_type: str, message: str, *, error_code: str | None = None, **details: Any
)

Source from the content-addressed store, hash-verified

764
765
766def api_error_response(
767 status: int, error_type: str, message: str, *, error_code: str | None = None, **details: Any
768) -> httpx2.Response:
769 error: dict[str, Any] = {"type": error_type, "message": message}
770 if error_code is not None:
771 error["details"] = {"error_code": error_code, **details}
772 return httpx2.Response(status, json={"type": "error", "error": error}, headers={"x-should-retry": "false"})
773
774
775def server_error() -> httpx2.Response:

Calls

no outgoing calls