Skip to content

Commit

Permalink
Update CHANGE
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Apr 2, 2024
1 parent 09f56a3 commit 3c9fd85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

## Version History

### v2.3.3

- :bug: Further extends fixes

### v2.3.2

- :bug: Avoid instanceof dependance
Expand Down
5 changes: 3 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ export default class PublicError extends Error {

super(err ? err.message : safe);

Object.setPrototypeOf(this, PublicError.prototype);

if (print && ![400, 401, 402, 403, 404].includes(status)) console.error(err ? err : 'Error: ' + safe);

this.status = status;
this.safe = safe || 'Generic Error';

this.name = 'PublicError';
Error.captureStackTrace(this, this.constructor);
}

static respond(err: unknown, res: Response, messages: object[] = []) {
Expand Down

0 comments on commit 3c9fd85

Please sign in to comment.