glynnbird commented on issue #236:
URL: https://github.com/apache/couchdb-nano/issues/236#issuecomment-762172045


   Thanks. I'm struggling to get the bottom of this one:
   
   - Nano returns a `stream.PassThrough` object because it wants to be able to 
return a stream to the user synchronously
   - we then run Axios to do the HTTP request to CouchDB. On success the axios 
stream is piped to the PassThrough stream and all is well. On failure (such as 
404), nothing gets piped by an 'error' event is emitted.
   
   I've tried all combinations of `close`, `end`, `destroy` on failure of the 
axios request but I can't persuade Node.js to kill these objects. 
   
   Here's the code in question if anyone wants to suggest some other approach: 
https://github.com/apache/couchdb-nano/blob/main/lib/nano.js#L382-L393


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to