superagent-intercept icon indicating copy to clipboard operation
superagent-intercept copied to clipboard

Q: Response argument could be undefined

Open WilliamHolmes opened this issue 9 years ago • 2 comments

Is it possible to ensure that err and res arguments are always object references so we can manipulate them? In some cases (ie. request timeout) res can be undefined.

As the arguments are Object references, receiving 'undefined' doesn't allow us to modify the object which eventually gets passed to the "real" superagent .end.

This may be an issue for the superagent npm.

WilliamHolmes avatar Apr 14 '16 11:04 WilliamHolmes

Let me think about it! I haven't looked at the code in a while. If you have already figured something out feel free to send a pullreq. I'd be happy to include it.

codesuki avatar Apr 20 '16 02:04 codesuki

Just had a look at it again. Totally forgot about it. req comes from superagent so we are just passing through what we get from it. Why would we need to change that?

codesuki avatar Aug 15 '16 04:08 codesuki