mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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;
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue