Skip to content

Commit 4468726

Browse files
Throw IOException for deleted files (#2215)
1 parent 15fdd36 commit 4468726

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

firebase-storage/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Unreleased
2+
- [fixed] Fixed an issue that caused the SDK to crash if the download location
3+
was deleted before the download completed. Instead, the download now fails.
4+
15
# 19.0.2
26
- [fixed] Fixed an encoding issue in `list()/listAll()` that caused us to miss
37
entries for folders that contained special characters.

firebase-storage/src/main/java/com/google/firebase/storage/FileDownloadTask.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ private boolean processResponse(final NetworkRequest request) throws IOException
130130
File outputFile = new File(mDestinationFile.getPath());
131131
if (!outputFile.exists()) {
132132
if (mResumeOffset > 0) {
133-
Log.e(TAG, "The file downloading to has been deleted:" + outputFile.getAbsolutePath());
134-
throw new IllegalStateException("expected a file to resume from.");
133+
throw new IOException("The file to download to has been deleted.");
135134
}
136135
boolean created = outputFile.createNewFile();
137136
if (!created) {

0 commit comments

Comments
 (0)