mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Prevent NodeErrors from being wrapped multiple times (#8301)
This commit is contained in:
committed by
GitHub
parent
64ceb16af6
commit
b267bf07e3
@@ -35,16 +35,16 @@ const COMMON_ERRORS: IDataObject = {
|
||||
* a value recursively inside an error object.
|
||||
*/
|
||||
export abstract class NodeError extends ExecutionBaseError {
|
||||
node: INode;
|
||||
constructor(
|
||||
readonly node: INode,
|
||||
error: Error | JsonObject,
|
||||
) {
|
||||
if (error instanceof NodeError) return error;
|
||||
|
||||
constructor(node: INode, error: Error | JsonObject) {
|
||||
if (error instanceof Error) {
|
||||
super(error.message, { cause: error });
|
||||
} else {
|
||||
super('', { errorResponse: error });
|
||||
}
|
||||
|
||||
this.node = node;
|
||||
const isError = error instanceof Error;
|
||||
const message = isError ? error.message : '';
|
||||
const options = isError ? { cause: error } : { errorResponse: error };
|
||||
super(message, options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user