:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)
This is a bug fix
:arrow_heading_down: What is the current behavior?
If the CachedNetworkImageProvider gets some error when fetching an image url, then internally the ImageLoader will rethrow that error.
This leads to the unwanted behavior that you get an uncaught exception.
And this for example then leads to faulty fatal errors being reported in Crashlytics.
:new: What is the new behavior (if this is a feature change)?
Instead of throwing the error inside the ImageLoader, we are now emitting the error as a stream error into the current stream.
This has the added benefit that this will not be an uncaught exception.
And all existing ErrorListeners, ErrorBuilders will still work.
:boom: Does this PR introduce a breaking change?
No
:bug: Recommendations for testing
You can test this change with the existing example app.
If you run the example app for a mobile device and enabled the debugger to catch uncaught exceptions, then with this fix you will not get any uncaught exceptions. And before this fix, you would get uncaught exceptions for the https://notAvalid.uri and the not a uri at all.
:sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)
This is a bug fix
:arrow_heading_down: What is the current behavior?
If the
CachedNetworkImageProvider
gets some error when fetching an image url, then internally theImageLoader
will rethrow that error. This leads to the unwanted behavior that you get an uncaught exception. And this for example then leads to faulty fatal errors being reported in Crashlytics.:new: What is the new behavior (if this is a feature change)?
Instead of throwing the error inside the
ImageLoader
, we are now emitting the error as a stream error into the current stream. This has the added benefit that this will not be an uncaught exception. And all existing ErrorListeners, ErrorBuilders will still work.:boom: Does this PR introduce a breaking change?
No
:bug: Recommendations for testing
You can test this change with the existing example app. If you run the example app for a mobile device and enabled the debugger to catch uncaught exceptions, then with this fix you will not get any uncaught exceptions. And before this fix, you would get uncaught exceptions for the
https://notAvalid.uri
and thenot a uri at all
.:memo: Links to relevant issues/docs
N/A
:thinking: Checklist before submitting
Screenshots
These screenshots come from VSCode running the previous version with
uncaught exceptions
turned on:And here is a screenshot coming from this version with
uncaught exceptions
turned on: