Show fs error in paint and edit#390
Show fs error in paint and edit#390JakobDev wants to merge 2 commits intodan200:masterfrom JakobDev:errormsg
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.
fileerr should not be global.
| file.close() | ||
| end | ||
| return ok, err | ||
| return ok, err, fileerr |
There was a problem hiding this comment.
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.