parent
f7076247f9
commit
959497067c
|
@ -8,8 +8,12 @@ export enum HttpCode {
|
||||||
ServerError = 500,
|
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 {
|
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)
|
super(message)
|
||||||
this.name = this.constructor.name
|
this.name = this.constructor.name
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue