Skip to content

Commit 3a7dcb1

Browse files
committed
fix(storage): TaskSnapshotObserver error callbacks
1 parent f5800a1 commit 3a7dcb1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/firebase-storage/index.android.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ export class Task implements ITask {
150150
complete?.();
151151
},
152152
onError(param0) {
153+
if (nextOrObserver) {
154+
if (typeof nextOrObserver === 'object') {
155+
nextOrObserver?.error?.(FirebaseError.fromNative(param0));
156+
}
157+
}
153158
error?.(FirebaseError.fromNative(param0));
154159
},
155160
})

packages/firebase-storage/index.ios.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export class Task implements ITask {
165165
nextOrObserver(TaskSnapshot.fromNative(snapshot));
166166
} else if (typeof nextOrObserver === 'object') {
167167
nextOrObserver?.next(TaskSnapshot.fromNative(snapshot));
168+
nextOrObserver?.error(FirebaseError.fromNative(snapshot.error));
168169
}
169170
}
170171

0 commit comments

Comments
 (0)