Skip to content

Commit

Permalink
Update convert.js
Browse files Browse the repository at this point in the history
In case of XML parsing error, display a warning and abort Grunt immediately (unless --force was specified). Disabling strict option for parsing can help.
  • Loading branch information
pbaumard committed May 3, 2014
1 parent b0a9b04 commit b607fd3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasks/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
handled = true;
var parse = require('xml2js').parseString;
parse(srcFiles, options, function(err, result) {
if (err) {
grunt.fail.warn('File ' + f.dest.cyan + ' parsing errors: ' + err);
}
data = JSON.stringify(result, null, options.indent);
grunt.file.write(f.dest, data);
finish();
Expand Down

0 comments on commit b607fd3

Please sign in to comment.