react-native-windows
react-native-windows copied to clipboard
ReactImage: propagate error messages to JS
Description
Enriches nativeEvent objects received on JS side in Image onError callback with error message.
Type of Change
- New feature (non-breaking change which adds functionality)
Why
Resolves #10491
What
In place of a bool flag indicating success use winrt::hstring for event payload and populate it with the error message. Empty string (default) indicates success.
Using a string instead of a more descriptive structure to avoid creating a new RT type required by winrt::EventHandler.
Testing
Compared Image page in RNTesterApp before and after the change. Confirmed the only difference is ErrorHandler section now showing "Failed to load image (E_NETWORK_ERROR)" message.
Microsoft Reviewers: Open in CodeFlow
@ilitosh, the PR is missing the change file. Please run "yarn change" to create it.
Sorry @ilitosh - can you merge this forward?
@ilitosh There's interest in taking this change but it needs the merge conflicts resolved. Are you going to take a look?
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.
@chrisglein rebased and checked in RNTester