mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 13:55:04 +02:00
Blow up if the error isn't EEXIST
This commit is contained in:
@@ -22,7 +22,7 @@ export async function loadSettings() {
|
||||
try {
|
||||
await mkdirAsync(paths.pathTo('settings'));
|
||||
} catch (e2) {
|
||||
if (e2.code !== 'EEXIST') console.error('Failed to create settings directory: ' + e2);
|
||||
if (e2.code !== 'EEXIST') throw e;
|
||||
}
|
||||
} else {
|
||||
console.error('Error reading settings file: ' + e);
|
||||
|
||||
@@ -192,7 +192,7 @@ export class StatsTracker {
|
||||
try {
|
||||
fs.mkdirSync(path.dirname(this.statsPath), { recursive: true });
|
||||
} 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' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user