mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
refactor(core): Diverge syntax error handling in expressions (#5124)
* ⚡ Diverge syntax error handling in expressions * ✏️ Expand comment
This commit is contained in:
parent
af55ecd64b
commit
044b153275
|
@ -298,6 +298,17 @@ export class Expression {
|
|||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// Syntax errors resolve to `Error` on the frontend and `null` on the backend.
|
||||
// This is a temporary divergence in evaluation behavior until we make the
|
||||
// breaking change to allow syntax errors to fail executions.
|
||||
if (
|
||||
typeof process === 'undefined' &&
|
||||
error instanceof Error &&
|
||||
error.name === 'SyntaxError'
|
||||
) {
|
||||
throw new Error('invalid syntax');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue