Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

SaxStream.write() can throw #71

Open
OrangeDog opened this Issue Apr 26, 2012 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

OrangeDog commented Apr 26, 2012

if there was a previous error. This makes using pipe difficult to deal with as there's no guarantee to the order of all the events involved and you can end up with an uncaught exception.

readStream.pipe(parser);
parser.on('error', function(err) {
  // handle error
  readStream.destroy();
};

In this example, the piping could end up writing more data (causing uncaught exceptions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment