Document HttpError
Also type the status.
This commit is contained in:
parent
f7076247f9
commit
959497067c
@ -8,8 +8,12 @@ export enum HttpCode {
|
||||
ServerError = 500,
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an error with a message and an HTTP status code. This code will be
|
||||
* used in the HTTP response.
|
||||
*/
|
||||
export class HttpError extends Error {
|
||||
public constructor(message: string, public readonly status: number, public readonly details?: object) {
|
||||
public constructor(message: string, public readonly status: HttpCode, public readonly details?: object) {
|
||||
super(message)
|
||||
this.name = this.constructor.name
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user