MCPcopy Create free account
hub / github.com/angular/dev-infra / createError

Method createError

github-actions/browserstack/set-browserstack-env.js:6167–6179  ·  view source on GitHub ↗
(ret, data)

Source from the content-addressed store, hash-verified

6165 return this.createError(ret, EMPTY_BUF);
6166 }
6167 createError(ret, data) {
6168 const { llhttp, contentLength, bytesRead } = this;
6169 if (contentLength && bytesRead !== parseInt(contentLength, 10)) {
6170 return new ResponseContentLengthMismatchError();
6171 }
6172 const ptr = llhttp.llhttp_get_error_reason(this.ptr);
6173 let message = "";
6174 if (ptr) {
6175 const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);
6176 message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
6177 }
6178 return new HTTPParserError(message, constants3.ERROR[ret], data);
6179 }
6180 destroy() {
6181 assert(this.ptr != null);
6182 assert(currentParser == null);

Callers 2

executeMethod · 0.45
finishMethod · 0.45

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected