You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/01/18 11:01:34 UTC

[GitHub] [couchdb-nano] glynnbird commented on issue #236: db.attachment.getAsStream method does not propagate axios errors to the caller

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:
users@infra.apache.org