mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Make expression resolution improvements (#4829)
⚡ Make expression resolution improvements
This commit is contained in:
@@ -254,6 +254,7 @@ export class Expression {
|
||||
// Execute the expression
|
||||
const returnValue = this.renderExpression(parameterValue, data);
|
||||
if (typeof returnValue === 'function') {
|
||||
if (returnValue.name === '$') throw new Error('invalid syntax');
|
||||
throw new Error('Expression resolved to a function. Please add "()"');
|
||||
} else if (typeof returnValue === 'string') {
|
||||
return returnValue;
|
||||
@@ -278,12 +279,8 @@ export class Expression {
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
error instanceof Error &&
|
||||
typeof error.message === 'string' &&
|
||||
error.name === 'SyntaxError'
|
||||
) {
|
||||
throw new Error(error.message);
|
||||
if (error instanceof Error && error.name === 'SyntaxError') {
|
||||
throw new Error('invalid syntax');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user