@alterior/common 3.14.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alterior/common",
3
- "version": "3.14.0",
3
+ "version": "3.14.1",
4
4
  "description": "Useful utilities for Typescript apps",
5
5
  "author": "The Alterior Project (https://github.com/alterior-mvc)",
6
6
  "license": "MIT",
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
  }
@@ -19,7 +19,7 @@ export interface PresentedProperty {
19
19
 
20
20
  export class PresentationSchema<T> {
21
21
  constructor(readonly type : Constructor<Presentation<T>>) {
22
- this.populate();
22
+ this.populate();
23
23
  }
24
24
 
25
25
  private populate() {