refactor(core): Stop reporting to Sentry node parameter value extraction failure (no-changelog) (#7587)

https://n8nio.sentry.io/issues/4595192919
This commit is contained in:
Iván Ovejero 2023-11-02 16:28:44 +01:00 committed by GitHub
parent 2854a0cf46
commit 81f43805aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@ import type {
INodeType,
NodeParameterValueType,
} from 'n8n-workflow';
import { NodeOperationError, NodeHelpers, LoggerProxy } from 'n8n-workflow';
import { NodeOperationError, NodeHelpers, LoggerProxy, WorkflowOperationError } from 'n8n-workflow';
function findPropertyFromParameterName(
parameterName: string,
@ -62,12 +62,12 @@ function executeRegexExtractValue(
): NodeParameterValueType | object {
const extracted = regex.exec(value);
if (!extracted) {
throw new Error(
throw new WorkflowOperationError(
`ERROR: ${parameterDisplayName} parameter's value is invalid. This is likely because the URL entered is incorrect`,
);
}
if (extracted.length < 2 || extracted.length > 2) {
throw new Error(
throw new WorkflowOperationError(
`Property "${parameterName}" has an invalid extractValue regex "${regex.source}". extractValue expects exactly one group to be returned.`,
);
}