INNER CODE UNIT · TypeScript

ParseError

x-cmd/x-cmd · mod/ajv/lib/ajv.ts:132

class ParseError extends Error {
    readonly path: string;
    readonly format: "JSON" | "YAML" | "TOML";
    readonly line?: number;
    readonly column?: number;
    constructor(path: string, format: "JSON" | "YAML" | "TOML", cause: unknown) {
        const m = cause instanceof Error ? cause.message : String(cause);
        super(`${format} parse error: ${m}`);
        this.name = "ParseError";
        this.path = path;
        this.format = format;
        const loc = ParseError.extractLocation(format, m);
        if (loc) {
            this.line = loc.line;
            this.column = loc.column;
        }
    }
    private static extractLocation(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…