sunflowerdeath / webfonts-generator

Generator of webfonts from svg icons
The Unlicense
271 stars 152 forks source link

Invalid XML causes an uncatchable error to be thrown #36

Open MadaraUchiha opened 6 years ago

MadaraUchiha commented 6 years ago

When trying to run generateWebfonts({ files: ['/path/to/invalid.xml'], e => console.log(e)), the application explodes with an uncatchable error like

events.js:136
      throw er; // Unhandled 'error' event
      ^

Error: Unexpected close tag
Line: 7
Column: 6
Char: >
    at error (/path/to/node_modules/sax/lib/sax.js:651:10)
    at strictFail (/path/to/node_modules/sax/lib/sax.js:677:7)
    at closeTag (/path/to/node_modules/sax/lib/sax.js:871:9)
    at SAXParser.write (/path/to/node_modules/sax/lib/sax.js:1436:13)
    at SAXStream.write (/path/to/node_modules/sax/lib/sax.js:239:18)
    at ReadStream.ondata (_stream_readable.js:642:20)
    at ReadStream.emit (events.js:159:13)
    at ReadStream.Readable.read (_stream_readable.js:478:10)
    at flow (_stream_readable.js:849:34)
    at resume_ (_stream_readable.js:831:3)

I'm guessing an error is thrown within a stream, and needs to be caught with the 'error' event in node.