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

Method wrap_errors

tests/test_middleware.py:833–838  ·  view source on GitHub ↗
(request: APIRequest, call_next: CallNext)

Source from the content-addressed store, hash-verified

831 )
832
833 def wrap_errors(request: APIRequest, call_next: CallNext) -> Any:
834 try:
835 return call_next(request)
836 except APIConnectionError as err:
837 # wrapping a retryable failure with `raise ... from` keeps it on the retry path
838 raise Boom("wrapped") from err
839
840 client = make_sync_client(middleware=[wrap_errors], max_retries=2)
841

Callers

nothing calls this directly

Calls 1

BoomClass · 0.85

Tested by

no test coverage detected