* Mock an undici request with a defined error.
(error)
| 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)) { |
nothing calls this directly
no test coverage detected