launcher icon indicating copy to clipboard operation
launcher copied to clipboard

Handle corrupted files without early exit

Open deathbeam opened this issue 6 years ago • 4 comments

  • Catch whole IOException from hash method - this can throw IOException when the file is corrupted
  • When destination file already existings but hash is invalid, delete destination file because it is most likely corrupted

Closes #53

Signed-off-by: Tomas Slusny [email protected]

deathbeam avatar Feb 16 '19 01:02 deathbeam

Reference: https://github.com/runelite/runelite/issues/7873

deathbeam avatar Feb 16 '19 01:02 deathbeam

Any update on this @Adam- ?

deathbeam avatar Jul 15 '19 11:07 deathbeam

I am pretty sure that the launcher already handles corrupt files correctly since creating a new FileOutputStream on a file overwrites it. #7873 looks like some sort of disk i/o error.

Adam- avatar Jul 15 '19 12:07 Adam-

Well, the change that prevents the corrupted files from crashing launcher is this https://github.com/runelite/launcher/pull/52/files#diff-818c02b00d346005372c6180a5539eacR307

And then the .delete() deletes that file just in case before creating new output stream

deathbeam avatar Jul 15 '19 12:07 deathbeam