fix(registry): preserve full traceback on tool dispatch errors
logger.error() only records the exception message string, silently discarding the stack trace. Switch to logger.exception() which automatically appends the full traceback to the log output. Without this change, when a tool handler raises an unexpected error the log shows only the exception type and message, making it impossible to determine which line caused the failure or trace through nested calls.
This commit is contained in:
parent
e265006fd6
commit
d2ec5aaacf
1 changed files with 1 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ class ToolRegistry:
|
||||||
return _run_async(entry.handler(args, **kwargs))
|
return _run_async(entry.handler(args, **kwargs))
|
||||||
return entry.handler(args, **kwargs)
|
return entry.handler(args, **kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Tool %s dispatch error: %s", name, e)
|
logger.exception("Tool %s dispatch error: %s", name, e)
|
||||||
return json.dumps({"error": f"Tool execution failed: {type(e).__name__}: {e}"})
|
return json.dumps({"error": f"Tool execution failed: {type(e).__name__}: {e}"})
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue