Code optimization

This commit is contained in:
Vladislav Hristov
2018-06-28 11:34:14 +03:00
parent 9660242234
commit b259ac76d6
2 changed files with 11 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ module.exports = (pathToFile) => {
write(data) {
return new Promise((resolve, reject) => {
fs.writeFile(path, data, { encoding: 'utf8' }, (error) => {
if (error) throw error;
if (error) reject(error);
return resolve();
});