-
Notifications
You must be signed in to change notification settings - Fork 193
Show fs error in paint and edit #390
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
Conversation
| local file = nil | ||
| local function innerSave() | ||
| file = fs.open( _sPath, "w" ) | ||
| file, fileerr = fs.open( _sPath, "w" ) |
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.
fileerr should not be global.
| file.close() | ||
| end | ||
| return ok, err | ||
| return ok, err, fileerr |
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.
Perhaps instead of storing fileerr in an upvalue and returning, you should have error(fileerr, 0). That way you don't need the separate err and fileerr values. It would be worth checking how it handles out of space errors though - those will be generated through file.write instead.
|
It's worth considering how this will interact with #377 - I'm presuming you'll get something like |
|
@SquidDev Thinking ahead for that case, should the programs modify the error message to remove the file name from the error (the part in brackets)? |
|
@Wilma456 What does this look like now that #377 has been merged? Would it be better to no longer show the file name, as it'll be included in the |
Show fs error in paint and edit

If saving failed, you now get a error, that shows why it failed.