MCPcopy Create free account
hub / github.com/MoonshotAI/checkpoint-engine / wrap_exception

Function wrap_exception

checkpoint_engine/api.py:59–65  ·  view source on GitHub ↗
(func: Callable[[], None])

Source from the content-addressed store, hash-verified

57 uds: str | None = None
58
59 def wrap_exception(func: Callable[[], None]) -> Response:
60 try:
61 func()
62 except Exception as e: # noqa: BLE001
63 logger.exception(f"wrap exception {func} failed")
64 return JSONResponse(content=str(e), status_code=500)
65 return Response(status_code=200)
66
67 @app.post("/v1/checkpoints/{checkpoint_name}/files")
68 async def register_files(checkpoint_name: str, req: RegisterRequest, raw: Request) -> Response:

Callers 5

register_filesFunction · 0.85
unregister_checkpointFunction · 0.85
gather_metasFunction · 0.85
load_metasFunction · 0.85
updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected