MCPcopy Create free account
hub / github.com/chimurai/http-proxy-middleware / constructor

Method constructor

src/errors.ts:4–18  ·  view source on GitHub ↗
(message: string, code: string)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected