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

Method replyWithError

github-actions/browserstack/set-browserstack-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 const originalDispatch = this[kOriginalDispatch];
11300 return function dispatch(opts, handler) {
11301 if (agent.isMockActive) {
11302 try {
11303 mockDispatch.call(this, opts, handler);
11304 } catch (error) {
11305 if (error instanceof MockNotMatchedError) {
11306 const netConnect = agent[kGetNetConnect]();
11307 if (netConnect === false) {
11308 throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`);
11309 }
11310 if (checkNetConnect(netConnect, origin)) {

Callers

nothing calls this directly

Calls 1

addMockDispatchFunction · 0.70

Tested by

no test coverage detected