From fa5961b5fc6235753b89aaf63734817aedb98960 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Wed, 26 Mar 2025 00:25:59 +0100 Subject: [PATCH] Add stack trace upon exception --- src/serena/mcp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/serena/mcp.py b/src/serena/mcp.py index 52196569..6e93bb3a 100644 --- a/src/serena/mcp.py +++ b/src/serena/mcp.py @@ -5,6 +5,7 @@ The Serena Model Context Protocol (MCP) Server import json import os import sys +import traceback from abc import ABC, abstractmethod from collections.abc import AsyncIterator from contextlib import asynccontextmanager @@ -96,8 +97,8 @@ class Tool(Component): try: return self._execute() except Exception as e: - log.error(f"Error executing tool: {e}") - return f"Error executing tool: {e}" + msg = f"Error executing tool: {e}\n{traceback.format_exc()}" + return msg @abstractmethod def _execute(self) -> str: