Better error handling for downloads

This commit is contained in:
inorichi
2015-12-04 14:35:39 +01:00
parent 3b11090e00
commit 260fa59799
4 changed files with 55 additions and 29 deletions

View File

@@ -134,8 +134,9 @@ public final class DiskUtils {
} catch (Exception e) {
if (bufferedSink != null) {
bufferedSink.close();
writeFile.delete();
}
writeFile.delete();
throw new IOException("Failed saving image");
}
return writeFile;