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

Method handle

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

Source from the content-addressed store, hash-verified

205
206 @override
207 def handle(self, request: APIRequest, call_next: CallNext) -> Any:
208 self.attempts.append(request.retries_taken)
209 try:
210 response = call_next(request)
211 except Exception as err:
212 self.errors.append(err)
213 raise
214 self.statuses.append(response.status_code)
215 return response
216
217 @override
218 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