Browse Source

catching errors

pull/34/head 1.0.6
Kevin Kwok 8 years ago
parent
commit
9d13b2339f
  1. 7
      src/browser/lang.js

7
src/browser/lang.js

@ -14,8 +14,11 @@ module.exports = function getLanguageData(req, res, cb){ @@ -14,8 +14,11 @@ module.exports = function getLanguageData(req, res, cb){
var lang = req.options.lang;
function saveDataFile(data){
db.put(lang, data, err => console.log('cached', lang, err))
cb(data)
try {
db.put(lang, data, err => console.log('cached', lang, err))
} finally {
cb(data)
}
}
db.open({ compression: false }, err => {

Loading…
Cancel
Save