Merge pull request #5409 from NodeBB/translator-no-catch

Fix translator catching JS errors in callbacks
v1.18.x
Julian Lam 8 years ago committed by GitHub
commit 409b8d8ebc

@ -450,10 +450,12 @@
return cb('');
}
Translator.create(lang).translate(text).then(function (output) {
return cb(output);
}).catch(function (err) {
Translator.create(lang).translate(text).catch(function (err) {
warn('Translation failed: ' + err.stack);
}).then(function (output) {
cb(output);
}).catch(function (err) {
console.error(err);
});
},

Loading…
Cancel
Save