What's the problem? Does the app crash or do you not want this to get printed in the logs?
Is there a way to hide these sorts of errors (also 404s)?
@renefloor The exception thrown by method BaseCacheManager.getFile was unhandled as expected.
+1, we're having the same issue occurring on many of our sessions. We don't fully grasp what this leads to currently.
Non-fatal Exception: java.lang.Exception
Connection closed while receiving data
BaseCacheManager.getFile (cache_manager.dart:120)
CachedNetworkImageState._animatedWidget (cached_image_widget.dart:270)
Furthermore, we are not quite sure how and where we should handle it correctly.
I found this issue was happend in this case: the CachedNetworkImageState rebuild with a new image url, for e.g., in a fastscrolling listview, and then the underlying Stream of getting file for the old url in StreamBuilder has been unsubscribed, but that Stream may throw an exception, the unhandled exception.
The getFile stream should be __cancelled__, not __unsubscribed__.
Any update on this issue? Seeing this error on console all the time is really annoying.
same problem
Same...
@yrom's pull request fixes the problem for me.
Here's a temporary solution until the pull request gets merged or until further discussion.
dependencies:
cached_network_image: ^1.1.1
flutter_cache_manager: ^1.1.1
dependency_overrides:
flutter_cache_manager:
git:
url: https://github.com/yrom/flutter_cache_manager
ref: feature/close-stream-on-cancel
duplicate of #273
Most helpful comment
I found this issue was happend in this case: the
CachedNetworkImageStaterebuild with a new image url, for e.g., in a fastscrolling listview, and then the underlyingStreamof getting file for the old url inStreamBuilderhas been unsubscribed, but thatStreammay throw an exception, the unhandled exception.The
getFilestream should be __cancelled__, not __unsubscribed__.