MCPcopy Index your code
hub / github.com/nodejs/node / createError

Method createError

deps/undici/undici.js:7309–7321  ·  view source on GitHub ↗
(ret, data)

Source from the content-addressed store, hash-verified

7307 return this.createError(ret, EMPTY_BUF);
7308 }
7309 createError(ret, data) {
7310 const { llhttp, contentLength, bytesRead } = this;
7311 if (contentLength !== -1 && bytesRead !== contentLength) {
7312 return new ResponseContentLengthMismatchError();
7313 }
7314 const ptr = llhttp.llhttp_get_error_reason(this.ptr);
7315 let message = "";
7316 if (ptr) {
7317 const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);
7318 message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
7319 }
7320 return new HTTPParserError(message, constants.ERROR[ret], data);
7321 }
7322 destroy() {
7323 assert(currentParser === null);
7324 assert(this.ptr != null);

Callers 3

test.jsFile · 0.45
executeMethod · 0.45
finishMethod · 0.45

Calls 3

indexOfMethod · 0.45
toStringMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected