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(); }