Add stack trace upon exception

This commit is contained in:
Dominik Jain committed 2025-03-26 00:25:59 +01:00
1 parent 60ea8fcc98
commit fa5961b5fc
1 file changed
+3 -2
+3 -2
View File
@@ -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: