Skip to content

Commit 84eb7ad

Browse files
committed
mcp(fix[_utils]): Log unexpected errors in handle_tool_errors
why: Generic exceptions were re-raised as ToolError without logging, making it impossible to diagnose unexpected errors in server logs. what: - Add logger.exception() before re-raising generic Exception as ToolError
1 parent 5955533 commit 84eb7ad

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libtmux/mcp/_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
387387
msg = f"tmux error: {e}"
388388
raise ToolError(msg) from e
389389
except Exception as e:
390+
logger.exception("unexpected error in MCP tool %s", fn.__name__)
390391
msg = f"Unexpected error: {type(e).__name__}: {e}"
391392
raise ToolError(msg) from e
392393

0 commit comments

Comments
 (0)