(message: string, code: string)
| 2 | code: string; |
| 3 | |
| 4 | constructor(message: string, code: string) { |
| 5 | super(message); |
| 6 | |
| 7 | // add custom `code` property |
| 8 | // so this can be used in src/plugins/default/error-response-plugin.ts to determine the status code to return |
| 9 | this.code = code; |
| 10 | |
| 11 | // set the correct name for the error class |
| 12 | this.name = this.constructor.name; |
| 13 | |
| 14 | // maintain proper stack trace (V8 environments) |
| 15 | if (Error.captureStackTrace) { |
| 16 | Error.captureStackTrace(this, this.constructor); |
| 17 | } |
| 18 | } |
| 19 | } |
nothing calls this directly
no outgoing calls
no test coverage detected