Improve error handling when saving the Configure Settings app
Currently if a game.settings.set call throws an error (e.g, DataField validation failure), it halts the entire save operation. Settings prior to it in the form are saved properly, ones after are not. To reproduce, register a setting that will error on save:
game.settings.register(MODULE_ID, "test-file-path-field-audio", {
scope: "world",
config: true,
name: "Audio!",
type: new fields.FilePathField({
categories: ["AUDIO"],
}),
});
then open the settings app and hit save. In this case, because of a quirk of FilePathField defaults, you get this error:
and anything after it in the list is not saved. Having one setting failure break the whole app should probably be avoided by putting the set call inside a try/catch.
Consider as part of #11386 ?
Yeah, this is a bit of an issue whenever I create a new world and set up all my favorite settings one by one. I go through dozens of modules and set dozens of settings, but when I finally click Save, nothing happens because 1 of them had a bug somewhere.
I think a good enough user experience would be to have the Save operation succeed, 95% of the settings updated as expected, with a UI notification error for the setting that failed -- doesn't have to say why it failed outside the console, but, the toast should inform the user which module and which setting id/label was at fault.