MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / anthropic_error_response

Function anthropic_error_response

uncommon_route/anthropic_compat.py:544–552  ·  view source on GitHub ↗

Build an Anthropic-format error body.

(status_code: int, message: str)

Source from the content-addressed store, hash-verified

542# ---------------------------------------------------------------------------
543
544def anthropic_error_response(status_code: int, message: str) -> dict[str, Any]:
545 """Build an Anthropic-format error body."""
546 return {
547 "type": "error",
548 "error": {
549 "type": _STATUS_TO_ERROR_TYPE.get(status_code, "api_error"),
550 "message": message,
551 },
552 }
553
554
555# ---------------------------------------------------------------------------

Callers 7

test_rate_limit_errorMethod · 0.90
test_auth_errorMethod · 0.90
test_unknown_statusMethod · 0.90
_spend_errorFunction · 0.90
_handle_chat_coreFunction · 0.90
_build_proxy_responseFunction · 0.90

Calls 1

getMethod · 0.45

Tested by 3

test_rate_limit_errorMethod · 0.72
test_auth_errorMethod · 0.72
test_unknown_statusMethod · 0.72