matthewmatician / xml-flow

An XML/HTML stream reader, now with less suck!
MIT License
55 stars 18 forks source link

.on("error") doesn't work? #12

Closed andreysm closed 5 years ago

andreysm commented 7 years ago

When saxStream encounters an invalid xml, it throws an exception (in strict mode). The error handler isn't called, and the exception isn't catched.

I don't see anywhere in the code, where you handle the "error" event. Probably you should forward saxStream.on("error") to emitter.emit("error"). (I'm not an expert in JS, though.)

Best regards

jhankim commented 6 years ago

I can reproduce as well, on('error', (e)=> {}) doesn't actually catch anything.

matthewmatician commented 5 years ago

Fixed via #20