mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-26 15:32:16 +00:00
38 lines
681 B
TypeScript
38 lines
681 B
TypeScript
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";
|
|
}
|
|
}
|