mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix: Do not throw on tool errors, instead return error message (#17558)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
import {
|
||||
NodeConnectionTypes,
|
||||
NodeOperationError,
|
||||
@@ -7,9 +9,6 @@ import {
|
||||
type SupplyData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { logWrapper } from '@utils/logWrapper';
|
||||
import { getConnectionHintNoticeField } from '@utils/sharedFields';
|
||||
|
||||
import { getTools } from './loadOptions';
|
||||
import type { McpServerTransport, McpAuthenticationOption, McpToolIncludeMode } from './types';
|
||||
import {
|
||||
@@ -294,11 +293,10 @@ export class McpClientTool implements INodeType {
|
||||
logWrapper(
|
||||
mcpToolToDynamicTool(
|
||||
tool,
|
||||
createCallTool(tool.name, client.result, (error) => {
|
||||
createCallTool(tool.name, client.result, (errorMessage) => {
|
||||
const error = new NodeOperationError(node, errorMessage, { itemIndex });
|
||||
void this.addOutputData(NodeConnectionTypes.AiTool, itemIndex, error);
|
||||
this.logger.error(`McpClientTool: Tool "${tool.name}" failed to execute`, { error });
|
||||
throw new NodeOperationError(node, `Failed to execute tool "${tool.name}"`, {
|
||||
description: error,
|
||||
});
|
||||
}),
|
||||
),
|
||||
this,
|
||||
|
||||
Reference in New Issue
Block a user