GithubHelp home page GithubHelp logo

Comments (5)

alabianca avatar alabianca commented on July 28, 2024

@mikehardenize Can you give me an example what you are currently trying to do for error handling? And the xml you are passing?

You should generally do standard stream error handling to catch an error. You can do: stream.on('error',(err)=>{})
Then on the error event unpipe the next stream. stream.unpipe() . Unfortunately doing error handling on stream pipelines is tricky.

I will look more into it when I get home from work.

If you have a suggestion on how the errors should be handled feel free to give a possible solution and we work it out.

from xml-to-json.

mikehardenize avatar mikehardenize commented on July 28, 2024

Hi. stream.on('error',(err)=>{}) is exactly what I tried, but it never triggered that handler. I attempted to trigger an error by simply removing the closing angle bracket for the entire XML. All that happened is the next stream in the chain received the raw XML instead of the JSON.

from xml-to-json.

alabianca avatar alabianca commented on July 28, 2024

Thanks @mikehardenize .
I was able to recreate it. Seems to be an issue with the validator. I am fixing it.

from xml-to-json.

alabianca avatar alabianca commented on July 28, 2024

Finally had some time to get a fix going for this. The fix is currently on branch xmlToJsonStream/patch/1.0.3 . All tests passed. Will try to have it published to npm mid this week.
Feel free to test it out before I merge.

from xml-to-json.

mikehardenize avatar mikehardenize commented on July 28, 2024

Thank you for fixing this

from xml-to-json.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.