-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.ts
More file actions
29 lines (27 loc) · 781 Bytes
/
Copy patherrors.ts
File metadata and controls
29 lines (27 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
export class JSONParseError extends Error {
constructor(
message: string,
public line: number,
public column: number,
public snippet?: string,
) {
super(
`JSON Parse Error at line ${line}, column ${column}: ${message}${
snippet ? `\nNear: ${snippet}` : ""
}`,
);
this.name = "JSONParseError";
}
}
export class TokenizerError extends JSONParseError {
constructor(message: string, line: number, column: number, snippet?: string) {
super(message, line, column, snippet);
this.name = "TokenizerError";
}
}
export class ParserError extends JSONParseError {
constructor(message: string, line: number, column: number, snippet?: string) {
super(message, line, column, snippet);
this.name = "ParserError";
}
}