We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f707624 commit 9594970Copy full SHA for 9594970
src/common/http.ts
@@ -8,8 +8,12 @@ export enum HttpCode {
8
ServerError = 500,
9
}
10
11
+/**
12
+ * Represents an error with a message and an HTTP status code. This code will be
13
+ * used in the HTTP response.
14
+ */
15
export class HttpError extends Error {
- public constructor(message: string, public readonly status: number, public readonly details?: object) {
16
+ public constructor(message: string, public readonly status: HttpCode, public readonly details?: object) {
17
super(message)
18
this.name = this.constructor.name
19
0 commit comments