forked from AssemblyScript/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.ts
More file actions
37 lines (31 loc) · 681 Bytes
/
error.ts
File metadata and controls
37 lines (31 loc) · 681 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
30
31
32
33
34
35
36
37
export class Error {
name: string = "Error";
stack: string = ""; // TODO
constructor(
public message: string = ""
) {}
toString(): string {
var message = this.message;
return message.length
? this.name + ": " + message
: this.name;
}
}
export class RangeError extends Error {
constructor(message: string = "") {
super(message);
this.name = "RangeError";
}
}
export class TypeError extends Error {
constructor(message: string = "") {
super(message);
this.name = "TypeError";
}
}
export class SyntaxError extends Error {
constructor(message: string = "") {
super(message);
this.name = "SyntaxError";
}
}