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

Method wrap_errors

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

Source from the content-addressed store, hash-verified

879 )
880
881 def wrap_errors(request: APIRequest, call_next: CallNext) -> Any:
882 try:
883 return call_next(request)
884 except APIConnectionError as err:
885 # wrapping a retryable failure with `raise ... from` keeps it on the retry path
886 raise Boom("wrapped") from err
887
888 client = make_sync_client(middleware=[wrap_errors], max_retries=2)
889

Callers

nothing calls this directly

Calls 1

BoomClass · 0.85

Tested by

no test coverage detected