diff --git a/src/fetch.ts b/src/fetch.ts index 5c51b083..0238bfa8 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -223,11 +223,11 @@ export class FetchFactory { res = await UndiciFetch(input, init); }); } catch (e: any) { - channels.response.publish({ + channels.fetchResponse.publish({ fetch: fetchMeta, - error: e, + error: e,n } as FetchResponseDiagnosticsMessage); - channels.fetchResponse.publish({ + channels.response.publish({ request: reqMeta, response: urllibResponse, error: e, diff --git a/src/index.ts b/src/index.ts index 0d4c5f28..141e1bee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,8 @@ export { MockAgent, ProxyAgent, Agent, Dispatcher, setGlobalDispatcher, getGlobalDispatcher, Request, RequestInfo, RequestInit, - Response, + Response, BodyInit, ResponseInit, + Headers, FormData, File, } from 'undici'; // HttpClient2 is keep compatible with urllib@2 HttpClient2 export {