From 5379bfd434003ef8ca5e6e1be0584336ecb6eabe Mon Sep 17 00:00:00 2001 From: michi Date: Sun, 13 Nov 2022 16:51:26 +0100 Subject: [PATCH] https://github.com/Baseflow/flutter_cached_network_image/issues/336 --- .../lib/src/image_provider/_image_loader.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cached_network_image/lib/src/image_provider/_image_loader.dart b/cached_network_image/lib/src/image_provider/_image_loader.dart index 9d590b05..5993ce3d 100644 --- a/cached_network_image/lib/src/image_provider/_image_loader.dart +++ b/cached_network_image/lib/src/image_provider/_image_loader.dart @@ -122,7 +122,7 @@ class ImageLoader implements platform.ImageLoader { yield decoded; } } - } catch (e) { + } catch (e, stacktrace) { // Depending on where the exception was thrown, the image cache may not // have had a chance to track the key in the cache at all. // Schedule a microtask to give the cache a chance to add the key. @@ -131,7 +131,8 @@ class ImageLoader implements platform.ImageLoader { }); errorListener?.call(); - rethrow; + chunkEvents.addError(e, stacktrace); + // rethrow; } finally { await chunkEvents.close(); }