[minor] Improved exception handling around storing settings.