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

Method replyWithError

github-actions/saucelabs/set-saucelabs-env.js:11301–11307  ·  view source on GitHub ↗

* Mock an undici request with a defined error.

(error)

Source from the content-addressed store, hash-verified

11299 }
11300 createMockScopeDispatchData({ statusCode, data, responseOptions }) {
11301 const responseData = getResponseData(data);
11302 const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {};
11303 const headers = __spreadValues(__spreadValues(__spreadValues({}, this[kDefaultHeaders]), contentLength), responseOptions.headers);
11304 const trailers = __spreadValues(__spreadValues({}, this[kDefaultTrailers]), responseOptions.trailers);
11305 return { statusCode, data, headers, trailers };
11306 }
11307 validateReplyParameters(replyParameters) {
11308 if (typeof replyParameters.statusCode === "undefined") {
11309 throw new InvalidArgumentError("statusCode must be defined");
11310 }

Callers

nothing calls this directly

Calls 1

addMockDispatchFunction · 0.70

Tested by

no test coverage detected