-
Notifications
You must be signed in to change notification settings - Fork 428
Handle exceptions while writing to files #4400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better I/O handling has been sorely needed for a while. I suspect the .tasproj
corruptions will end with this.
src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.IToolForm.cs
Outdated
Show resolved
Hide resolved
fde3481
to
0798074
Compare
Highlights of force push:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I believe this is ready for merge. See edited OP for notes on some behavior changes. |
Removed ISaveRam refactor. |
…e until writing has completed. Avoids crashing and prevents loss of data in the event of an exception mid-write.
…still broken on close and on TAStudio open.
…celing flow even though not all asking and error handling is implemented yet. Also, fix: respect the cancel button.
…properly checks the autosave config option.
Are there any reasons to not merge this? |
Most file writes now use a new system that allows for error detection and handling. (includes movies, config file, and all tools)
When an exception occurs, a message box appears alerting the user. If there is an exception while doing a save-on-close, the user is given the option to try again, skip saving, or cancel closing. (Includes a bug fix where an existing dialog offering the cancel option did not actually cancel.)
Addresses #4258.
Fixes an issue where the CheatList was being forcibly autosaved when closing a game, ignoring the autosave config option.
Changes behavior when saving the config file fails. Previously it would silently fail (and report success if "saved" via the menu item), now it has the same error handling as other updated file writes. The silent fail seems to have been intended to allow using a read-only config file. If we want to bring this back, I suggest making a config option to not save on close instead. As-is, a read-only file will still work you just have to click "No" after closing EmuHawk when it tells you it can't save the config file.
Check if completed: