feat(editor): Improve errors in output panel (#8644)

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
Giulio Andreini
2024-03-07 17:08:01 +01:00
committed by GitHub
parent 6e2aa405fc
commit 5301323906
38 changed files with 772 additions and 287 deletions

View File

@@ -13,6 +13,8 @@ import { PythonSandbox } from './PythonSandbox';
import { getSandboxContext } from './Sandbox';
import { standardizeOutput } from './utils';
import set from 'lodash/set';
const { CODE_ENABLE_STDOUT } = process.env;
export class Code implements INodeType {
@@ -133,7 +135,10 @@ export class Code implements INodeType {
try {
items = (await sandbox.runCodeAllItems()) as INodeExecutionData[];
} catch (error) {
if (!this.continueOnFail()) throw error;
if (!this.continueOnFail()) {
set(error, 'node', node);
throw error;
}
items = [{ json: { error: error.message } }];
}
@@ -158,7 +163,10 @@ export class Code implements INodeType {
try {
result = await sandbox.runCodeEachItem();
} catch (error) {
if (!this.continueOnFail()) throw error;
if (!this.continueOnFail()) {
set(error, 'node', node);
throw error;
}
returnData.push({
json: { error: error.message },
pairedItem: {