diff --git a/src/main/settings.ts b/src/main/settings.ts index cc2a2d9..2ea76f9 100644 --- a/src/main/settings.ts +++ b/src/main/settings.ts @@ -30,7 +30,11 @@ function createSettingsStore(file: string, settings: T) const store = new SettingsStore(settings); store.addGlobalChangeListener(o => { mkdirSync(dirname(file), { recursive: true }); - writeFileSync(file, JSON.stringify(o, null, 4)); + try { + writeFileSync(file, JSON.stringify(o, null, 4)); + } catch (err) { + console.error(`Failed to save ${file}`, err); + } }); return store;