MCPcopy Create free account
hub / github.com/IBM/mcp-cli / _safe_close

Function _safe_close

src/mcp_cli/run_command.py:140–145  ·  view source on GitHub ↗

Close the ToolManager, swallowing any exception during shutdown.

(tm)

Source from the content-addressed store, hash-verified

138
139
140async def _safe_close(tm) -> None:
141 """Close the ToolManager, swallowing any exception during shutdown."""
142 try:
143 await tm.close()
144 except Exception as e: # noqa: BLE001
145 logger.debug("Error during ToolManager close: %s", e)
146
147
148# --------------------------------------------------------------------------- #

Callers 5

_start_chatFunction · 0.90
run_commandFunction · 0.85
_innerFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by 2