You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ ClientRequestInterceptor }=require('@mswjs/interceptors/ClientRequest')consthttp=require('http');constinterceptor=newClientRequestInterceptor({name: 'my-interceptor',})interceptor.apply();interceptor.on('request',({ request })=>{request.respondWith(newResponse('hello'))});http.get('http://nowhere.com/',res=>{res.destroy(newError('hey'))}).on('error',e=>{console.log(e)// never get here!!!})
Instead of getting to the req's error listener, this throws an error.
Expected behavior: I think we need to listen to the error event in the request (from the socket) and pass it through. docs
The text was updated successfully, but these errors were encountered:
Instead of getting to the req's
error
listener, this throws an error.Expected behavior: I think we need to listen to the
error
event in the request (from the socket) and pass it through.docs
The text was updated successfully, but these errors were encountered: