| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1x 60x 60x 60x | export class BaseError extends Error {
public status: number;
public type: string;
constructor(message: string, status: number, type: string) {
// Calling parent constructor of base Error class.
super(message);
// Typing for easy reference
this.type = type;
// Store the HTTP status code
this.status = status;
}
}
|