MCPcopy Index your code
hub / github.com/Agenta-AI/agenta / wrapper

Function wrapper

api/oss/src/utils/exceptions.py:33–49  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

31 def decorator(func):
32 @wraps(func)
33 async def wrapper(*args, **kwargs):
34 try:
35 return await func(*args, **kwargs)
36 except HTTPException as e:
37 raise e
38 except Exception:
39 support_id = str(uuid4())
40
41 log.error("--- HANDLING EXCEPTION ---")
42 log.error(f"support_id={support_id} & operation_id={func.__name__}")
43 log.error(f"{format_exc()}")
44 log.error("--------------------------")
45
46 raise HTTPException(
47 status_code=500,
48 detail=f"An unexpected error occurred with operation_id={func.__name__}. Please contact support with support_id={support_id}.",
49 )
50
51 return wrapper
52

Callers

nothing calls this directly

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected