Skip to content

Commit 8ddcf88

Browse files
fix(storage): remove duplicate error callback (#1366)
1 parent b7c442e commit 8ddcf88

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

aws-storage-s3/src/main/java/com/amplifyframework/storage/s3/operation/AWSS3StorageDownloadFileOperation.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,7 @@ public void onStateChanged(int transferId, TransferState state) {
173173
onSuccess.accept(StorageDownloadFileResult.fromFile(file));
174174
return;
175175
case FAILED:
176-
onError.accept(new StorageException(
177-
"Storage download operation was interrupted.",
178-
"Please verify that you have a stable internet connection."
179-
));
180-
return;
176+
// no-op;
181177
default:
182178
// no-op;
183179
}

aws-storage-s3/src/main/java/com/amplifyframework/storage/s3/operation/AWSS3StorageUploadFileOperation.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,7 @@ public void onStateChanged(int transferId, TransferState state) {
185185
onSuccess.accept(StorageUploadFileResult.fromKey(getRequest().getKey()));
186186
return;
187187
case FAILED:
188-
onError.accept(new StorageException(
189-
"Storage upload operation was interrupted.",
190-
"Please verify that you have a stable internet connection."
191-
));
192-
return;
188+
// no-op;
193189
default:
194190
// no-op;
195191
}

testutils/src/main/java/com/amplifyframework/testutils/Await.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ private static <R, E extends Throwable> void await(
146146
resultContainer.set(result);
147147
latch.countDown();
148148
}, error -> {
149+
if (errorContainer.get() != null) {
150+
throw new RuntimeException("Error callback called more than once with error: " + error);
151+
}
149152
errorContainer.set(error);
150153
latch.countDown();
151154
}

0 commit comments

Comments
 (0)