MCPcopy Create free account
hub / github.com/Accenture/mcp-bench / async_wrapper

Function async_wrapper

utils/error_handler.py:45–53  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

43 def decorator(func: Callable) -> Callable:
44 @functools.wraps(func)
45 async def async_wrapper(*args, **kwargs) -> Any:
46 try:
47 return await func(*args, **kwargs)
48 except Exception as e:
49 logger.log(log_level, f"ERROR in {operation_name}: {e}")
50 logger.log(log_level, f"Full traceback: {traceback.format_exc()}")
51 if reraise:
52 raise
53 return None
54
55 @functools.wraps(func)
56 def sync_wrapper(*args, **kwargs) -> Any:

Callers

nothing calls this directly

Calls 2

retry_with_loggingFunction · 0.85
record_errorMethod · 0.80

Tested by

no test coverage detected