trxcllnt commented on PR #389:
URL: https://github.com/apache/arrow-js/pull/389#issuecomment-4007070095

   This PR should also update the node Transform stream's 
[`_write()`](https://github.com/apache/arrow-js/blob/ed42d662c221f3748d75566bfa1ce3f13ee026a6/src/io/node/writer.ts#L49-L50)
 implementation to try/catch the error and pass it to the callback:
   ```ts
       _write(x: any, _: string, cb: CB) {
           const writer = this._writer;
           let err = [];
           try {
             writer?.write(x);
           } catch (e) {
             err.push(e);
           }
           cb && cb.apply(undefined, err);
           return true;
       }
   ```
   
   I can't recall at the moment what DOM streams do if `write()` throws, but 
it's also worth considering the impact of this change to [this 
line](https://github.com/apache/arrow-js/blob/ed42d662c221f3748d75566bfa1ce3f13ee026a6/src/io/whatwg/writer.ts#L39).
   
   Trying to think through other implications of throwing here.


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to