21 lines
393 B
TypeScript
21 lines
393 B
TypeScript
import HttpStatus from "./http-status";
|
|
|
|
class HttpError extends Error {
|
|
/**
|
|
* HTTP Status Code
|
|
*/
|
|
status: HttpStatus;
|
|
message: string;
|
|
code?: string;
|
|
|
|
constructor(status: HttpStatus, message: string, code?: string) {
|
|
super(message);
|
|
|
|
this.name = "HttpError";
|
|
this.status = status;
|
|
this.message = message;
|
|
this.code = code;
|
|
}
|
|
}
|
|
|
|
export default HttpError;
|