You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2018. It is now read-only.
Just wondering what's the best way to handle an error in a paused stream that is waiting for a promise to resolve. The example I have is something like the following case:
// Going to map some rows from a CSV readerfunctionmapRow(){returnfunction(data){// Yes, we want `this` in the context of the calling `through` function.varself=this;// Pausing the stream while we handle the promise.self.pause();somePromisaryService(data).then(function(){self.emit(data);self.resume();}).catch(function(err){// Ok, how do we deal with this???});}}aCsvReader().pipe(through(mapRow()));
Is there anything available in the context of through that I can use or do I need to introduce something external to catch any error in the promise?