Skip to content

Commit c303009

Browse files
author
wangfan001
committed
Add error handling to cache store future operations
- Add catchError handler to properly propagate errors to completer - Ensure _futureCache cleanup on both success and error paths
1 parent 6e7fc6e commit c303009

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flutter_cache_manager/lib/src/cache_store.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ class CacheStore {
8484
}
8585
completer.complete(cacheObject);
8686
_futureCache.remove(key);
87+
}).catchError((err) {
88+
completer.completeError(err);
89+
_futureCache.remove(key);
8790
});
8891
_futureCache[key] = completer.future;
8992
}

0 commit comments

Comments
 (0)