Blow up if the error isn't EEXIST

This commit is contained in:
Eliot Partridge
2019-08-29 23:14:37 -05:00
parent aaee2dc8b7
commit 0d04bc06ae
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ export async function loadSettings() {
try { try {
await mkdirAsync(paths.pathTo('settings')); await mkdirAsync(paths.pathTo('settings'));
} catch (e2) { } catch (e2) {
if (e2.code !== 'EEXIST') console.error('Failed to create settings directory: ' + e2); if (e2.code !== 'EEXIST') throw e;
} }
} else { } else {
console.error('Error reading settings file: ' + e); console.error('Error reading settings file: ' + e);
+1 -1
View File
@@ -192,7 +192,7 @@ export class StatsTracker {
try { try {
fs.mkdirSync(path.dirname(this.statsPath), { recursive: true }); fs.mkdirSync(path.dirname(this.statsPath), { recursive: true });
} catch (e) { } catch (e) {
if (e.code !== 'EEXIST') console.error('Failed to create stats directory: ' + e); if (e.code !== 'EEXIST') throw e;
} }
fs.writeFileSync(this.statsPath, encodeCSV(statsHeaders), { encoding: 'utf8' }); fs.writeFileSync(this.statsPath, encodeCSV(statsHeaders), { encoding: 'utf8' });
} }