feat(core): Show sub-node error on the logs pane. Open logs pane on sub-node error (#10248)

This commit is contained in:
Eugene
2024-08-02 16:00:09 +02:00
committed by GitHub
parent 0faf46f4f8
commit 57d1c9a99e
7 changed files with 333 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ import type {
SupplyData,
ExecutionError,
} from 'n8n-workflow';
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
import type { Sandbox } from 'n8n-nodes-base/dist/nodes/Code/Sandbox';
import { getSandboxContext } from 'n8n-nodes-base/dist/nodes/Code/Sandbox';
@@ -208,7 +209,7 @@ export class ToolCode implements INodeType {
try {
response = await runFunction(query);
} catch (error: unknown) {
executionError = error as ExecutionError;
executionError = new NodeOperationError(this.getNode(), error as ExecutionError);
response = `There was an error: "${executionError.message}"`;
}
@@ -229,6 +230,7 @@ export class ToolCode implements INodeType {
} else {
void this.addOutputData(NodeConnectionType.AiTool, index, [[{ json: { response } }]]);
}
return response;
},
}),