mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-01 09:17:08 +02:00
Co-authored-by: Danny Martini <danny@n8n.io> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 lines
530 B
TypeScript
12 lines
530 B
TypeScript
import { MemoryLimitError, SecurityViolationError, SyntaxError, TimeoutError } from '../types';
|
|
|
|
export type ExpressionErrorType = 'timeout' | 'memory_limit' | 'security' | 'syntax' | 'unknown';
|
|
|
|
export function classifyExpressionError(error: unknown): ExpressionErrorType {
|
|
if (error instanceof TimeoutError) return 'timeout';
|
|
if (error instanceof MemoryLimitError) return 'memory_limit';
|
|
if (error instanceof SecurityViolationError) return 'security';
|
|
if (error instanceof SyntaxError) return 'syntax';
|
|
return 'unknown';
|
|
}
|