* When a client request errors, emit Network.loadingFailed event. * https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-loadingFailed * @param {{ request: undici.Request, error: any }} event
({ request, error })
| 95 | * @param {{ request: undici.Request, error: any }} event |
| 96 | */ |
| 97 | function onClientRequestError({ request, error }) { |
| 98 | if (typeof request[kInspectorRequestId] !== 'string') { |
| 99 | return; |
| 100 | } |
| 101 | Network.loadingFailed({ |
| 102 | requestId: request[kInspectorRequestId], |
| 103 | timestamp: getMonotonicTime(), |
| 104 | // TODO(legendecas): distinguish between `undici.request` and `undici.fetch`. |
| 105 | type: kResourceType.Fetch, |
| 106 | errorText: error.message, |
| 107 | }); |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * When a chunk of the request body is being sent, cache it until `getRequestPostData` request. |
nothing calls this directly
no test coverage detected