feat: add type to http error dev message
This commit is contained in:
parent
8a512c2ba3
commit
302f129e91
1 changed files with 4 additions and 2 deletions
|
|
@ -1,14 +1,16 @@
|
|||
import HttpStatus from "./http-status";
|
||||
|
||||
type DevMessage = "missing_or_invalid_parameter" | "data_exists" | "unknown_url" | "data_not_found";
|
||||
|
||||
class HttpError extends Error {
|
||||
/**
|
||||
* HTTP Status Code
|
||||
*/
|
||||
status: HttpStatus;
|
||||
message: string;
|
||||
devMessage?: string;
|
||||
devMessage?: DevMessage;
|
||||
|
||||
constructor(status: HttpStatus, message: string, devMessage?: string) {
|
||||
constructor(status: HttpStatus, message: string, devMessage?: DevMessage) {
|
||||
super(message);
|
||||
|
||||
this.name = "HttpError";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue