mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Do not show errors not processed by n8n (no-changelog) (#9598)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -100,3 +100,5 @@ export const SINGLE_EXECUTION_NODES: { [key: string]: { [key: string]: NodeParam
|
||||
operation: [undefined], // default info
|
||||
},
|
||||
};
|
||||
|
||||
export const OBFUSCATED_ERROR_MESSAGE = 'Internal error';
|
||||
|
||||
@@ -850,7 +850,7 @@ type FunctionsBaseWithRequiredKeys<Keys extends keyof FunctionsBase> = Functions
|
||||
export type ContextType = 'flow' | 'node';
|
||||
|
||||
type BaseExecutionFunctions = FunctionsBaseWithRequiredKeys<'getMode'> & {
|
||||
continueOnFail(): boolean;
|
||||
continueOnFail(error?: Error): boolean;
|
||||
evaluateExpression(expression: string, itemIndex: number): NodeParameterValueType;
|
||||
getContext(type: ContextType): IContextObject;
|
||||
getExecuteData(): IExecuteData;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { INode, JsonObject } from '@/Interfaces';
|
||||
import type { NodeOperationErrorOptions } from './node-api.error';
|
||||
import { NodeError } from './abstract/node.error';
|
||||
import { ApplicationError } from './application.error';
|
||||
import { OBFUSCATED_ERROR_MESSAGE } from '../Constants';
|
||||
|
||||
/**
|
||||
* Class for instantiating an operational error, e.g. an invalid credentials error.
|
||||
@@ -16,8 +18,14 @@ export class NodeOperationError extends NodeError {
|
||||
if (error instanceof NodeOperationError) {
|
||||
return error;
|
||||
}
|
||||
|
||||
let obfuscateErrorMessage = false;
|
||||
|
||||
if (typeof error === 'string') {
|
||||
error = new Error(error);
|
||||
} else if (!(error instanceof ApplicationError)) {
|
||||
// this error was no processed by n8n, obfuscate error message
|
||||
obfuscateErrorMessage = true;
|
||||
}
|
||||
|
||||
super(node, error);
|
||||
@@ -26,6 +34,7 @@ export class NodeOperationError extends NodeError {
|
||||
error.messages.forEach((message) => this.addToMessages(message));
|
||||
}
|
||||
|
||||
if (obfuscateErrorMessage) this.message = OBFUSCATED_ERROR_MESSAGE;
|
||||
if (options.message) this.message = options.message;
|
||||
if (options.level) this.level = options.level;
|
||||
if (options.functionality) this.functionality = options.functionality;
|
||||
|
||||
Reference in New Issue
Block a user