superagent
superagent copied to clipboard
Can't use `request.on('error')` on plugins/middleware via `#.use()`
On my requests, I am attaching a common error handler with .use(errorHandler). I want to handle 401's and redirect to my login page.
My problem is that the error event handler is not being executed when an error occurs. If i console.log something on the errorHandler, it works, but if I do request.on('error', handler), the handler never gets called.
In superagent 3 the error event works in more situations. Please test it.
Oh okay thanks, I was using 2.3.0. I guess I can close the issue for now, because I am not using 3.x at the moment.