Comments (5)
@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.
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.
Thanks @mikehardenize .
I was able to recreate it. Seems to be an issue with the validator. I am fixing it.
from xml-to-json.
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.
Thank you for fixing this
from xml-to-json.
Related Issues (8)
- throw er; // Unhandled 'error' event HOT 1
- Repetitive xml tag occurs Illegal start of XML tag error in stream mode HOT 3
- bug in findClosingIndex HOT 3
- TypeError: xml.replace is not a function HOT 1
- Incorrect parsing of child elements that share their parent's tag HOT 1
- First instance of each type of child tag after the first does not honor attributesMode
- cleanXML function removes all content between first and last discovered XML comments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xml-to-json.