fix: Always retain original errors in the error chain on NodeOperationError (#4951)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-12-16 18:47:20 +01:00
committed by GitHub
parent 323bd78067
commit 231257d081
5 changed files with 19 additions and 11 deletions

View File

@@ -166,7 +166,9 @@ export const parseAndSetBodyJson = (
} catch (err) {
throw new NodeOperationError(
this.getNode(),
`The '${parameterName}' property must be valid JSON, but cannot be parsed: ${err}`,
new Error(`The '${parameterName}' property must be valid JSON, but cannot be parsed`, {
cause: err,
}),
);
}
return requestOptions;