react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

ReactImage: propagate error messages to JS

Open ilitosh opened this issue 3 years ago • 1 comments
trafficstars

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 avatar Sep 02 '22 10:09 ilitosh

@ilitosh, the PR is missing the change file. Please run "yarn change" to create it.

vmoroz avatar Sep 08 '22 19:09 vmoroz

Sorry @ilitosh - can you merge this forward?

acoates-ms avatar Sep 27 '22 22:09 acoates-ms

@ilitosh There's interest in taking this change but it needs the merge conflicts resolved. Are you going to take a look?

chrisglein avatar Dec 14 '22 19:12 chrisglein

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.

ghost avatar Dec 21 '22 21:12 ghost

@chrisglein rebased and checked in RNTester

ilitosh avatar Dec 23 '22 15:12 ilitosh