/** Thrown while tokenizing or parsing an expression. */ export class SqlSyntaxError extends Error { /** * @param {string} message * @param {{pos?: number, line?: number, col?: number}} [location] */ constructor(message, location = {}) { const { pos, line, col } = location; const suffix = line != null ? ` (line ${line}, col ${col})` : ''; super(`${message}${suffix}`); this.name = 'SqlSyntaxError'; this.pos = pos; this.line = line; this.col = col; } } /** Thrown while evaluating a parsed expression against data (type errors, unknown functions, etc). */ export class SqlEvaluationError extends Error { /** @param {string} message */ constructor(message) { super(message); this.name = 'SqlEvaluationError'; } }