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

Method handle

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

Source from the content-addressed store, hash-verified

231
232 @override
233 def handle(self, request: APIRequest, call_next: CallNext) -> Any:
234 self.attempts.append(request.retries_taken)
235 try:
236 response = call_next(request)
237 except Exception as err:
238 self.errors.append(err)
239 raise
240 self.statuses.append(response.status_code)
241 return response
242
243 @override
244 async def handle_async(self, request: APIRequest, call_next: AsyncCallNext) -> Any:

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected