fix(Set Node): Fix behaviour when selecting continueOnFail & PairedItem (#5257)

* 🐛 Fix bug on continueOnFail with pairedItem

* 🐛  Fix pairedItem continueOnFail for the Set Node

* 🎨  Add the ExpressionExtensionError back

*  import fix

---------

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
agobrech 2023-01-31 09:25:08 +01:00 committed by GitHub
parent c6bc57b4cb
commit a8637a0bc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,6 +70,7 @@ import {
OAuth2GrantType,
deepCopy,
fileTypeFromMimeType,
ExpressionError,
} from 'n8n-workflow';
import { Agent } from 'https';
@ -1806,12 +1807,15 @@ export function getNodeParameter(
additionalKeys,
executeData,
);
cleanupParameterData(returnData);
} catch (e) {
if (e.context) e.context.parameter = parameterName;
e.cause = value;
throw e;
if (e instanceof ExpressionError && node.continueOnFail && node.name === 'Set') {
returnData = [{ name: undefined, value: undefined }];
} else {
if (e.context) e.context.parameter = parameterName;
e.cause = value;
throw e;
}
}
// This is outside the try/catch because it throws errors with proper messages