@alterior/common 3.13.4 → 3.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/errors.ts +4 -2
- package/src/presentation.ts +1 -1
package/package.json
CHANGED
package/src/errors.ts
CHANGED
|
@@ -137,9 +137,11 @@ export class AccessDeniedError extends SystemError {
|
|
|
137
137
|
export class HttpError extends Error {
|
|
138
138
|
constructor(
|
|
139
139
|
public statusCode : number,
|
|
140
|
-
public body : any,
|
|
141
|
-
public headers : string[][]
|
|
140
|
+
public body? : any,
|
|
141
|
+
public headers? : string[][]
|
|
142
142
|
) {
|
|
143
143
|
super(`HttpError statusCode=${statusCode} [are you sure you meant to catch this?]`);
|
|
144
|
+
this.body ??= { status: statusCode };
|
|
145
|
+
this.headers ??= [];
|
|
144
146
|
}
|
|
145
147
|
}
|