fix: remove useless catchs and empty line

This commit is contained in:
Barış Soner Uşaklı
2019-08-11 00:13:41 -04:00
parent fd5f9822bd
commit 5fce45580a
3 changed files with 3 additions and 13 deletions

View File

@@ -1,5 +1,4 @@
'use strict';
const util = require('util');

View File

@@ -13,13 +13,8 @@ const files = fs.readdirSync(path.join(__dirname, '../public/vendor/jquery/timea
Languages.timeagoCodes = files.filter(f => f.startsWith('jquery.timeago')).map(f => f.split('.')[2]);
Languages.get = async function (language, namespace) {
let data = await readFileAsync(path.join(languagesPath, language, namespace + '.json'), 'utf8');
try {
data = JSON.parse(data) || {};
} catch (err) {
throw err;
}
return data;
const data = await readFileAsync(path.join(languagesPath, language, namespace + '.json'), 'utf8');
return JSON.parse(data) || {};
};
let codeCache = null;

View File

@@ -134,11 +134,7 @@ widgets.getArea = async function (template, location) {
if (!result) {
return [];
}
try {
return parseWidgetData(result);
} catch (err) {
throw err;
}
};
function parseWidgetData(data) {