Skip to content

Commit 9792f0d

Browse files
authored
refactor(agent-tars): too call log (#351)
1 parent ca6b11e commit 9792f0d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

apps/agent-tars/src/main/ipcRoutes/action.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,14 @@ export const actionRoute = t.router({
9393
result,
9494
);
9595
results.push(result);
96-
} catch (e) {
97-
logger.error(
98-
'[actionRoute.executeTool] execute tool error',
99-
mcpTool.name,
100-
e,
101-
);
96+
} catch (error) {
97+
const rawErrorMessage =
98+
error instanceof Error ? error.message : JSON.stringify(error);
99+
const errorMessage = `Failed to execute tool "${mcpTool.name}": ${rawErrorMessage}`;
100+
logger.error(`[actionRoute.executeTool] ${errorMessage}`);
102101
results.push({
103102
isError: true,
104-
content: [JSON.stringify(e)],
103+
content: [errorMessage],
105104
});
106105
}
107106
} else {

0 commit comments

Comments
 (0)