flecs
flecs copied to clipboard
Validate config.json on launch
Currently, if config.json is corrupted somehow, the app just won't launch / shows a white window / error, which makes it very hard for users to fix
error thrown from https://github.com/th-ch/youtube-music/blob/23058729f3965deb0bff9b638feb5d419da6e913/config/store.js#L79-L83
To fix this I propose either:
-
- clearInvalidConfig: false, + clearInvalidConfig: true,
- wrap the Store constructor inside a try...catch,
on catch prompt the user:
then reset if yes / quit if noError in config.json "SyntaxError: Unexpected string in JSON at position 2950" reset the config to its default options?
bonus: validate schema when changing values https://github.com/sindresorhus/electron-store#schema even more bonus: validate schema on launch