added try..catch to server parsing of translations, in case a file has a syntax error -- #1401

This commit is contained in:
Julian Lam
2014-04-18 12:54:34 -04:00
parent b4dc2eebe9
commit 8934ac1a2d

View File

@@ -220,7 +220,12 @@
return winston.error(err.message);
}
callback(JSON.parse(data.toString()));
try {
callback(JSON.parse(data.toString()));
} catch (e) {
winston.error('Could not parse `' + filename + '.json`, syntax error? Skipping...');
callback({});
}
});
}