fix: Prevent NodeApiError rewraping (no-changelog) (#9627)

This commit is contained in:
Michael Kret
2024-06-05 14:21:32 +03:00
committed by GitHub
parent 411ffbda7f
commit 37531cdb7d
3 changed files with 11 additions and 7 deletions

View File

@@ -13,9 +13,13 @@ export class NodeOperationError extends NodeError {
error: Error | string | JsonObject,
options: NodeOperationErrorOptions = {},
) {
if (error instanceof NodeOperationError) {
return error;
}
if (typeof error === 'string') {
error = new Error(error);
}
super(node, error);
if (error instanceof NodeError && error?.messages?.length) {