Skip to content

[iOS] Fixes Reject error kind in Fabric - #41955

Closed
zhongwuzw wants to merge 6 commits into
react:mainfrom
zhongwuzw:features/fix_reject_error_kind_fabric
Closed

[iOS] Fixes Reject error kind in Fabric#41955
zhongwuzw wants to merge 6 commits into
react:mainfrom
zhongwuzw:features/fix_reject_error_kind_fabric

Conversation

@zhongwuzw

Copy link
Copy Markdown
Contributor

Summary:

Fixes#41950 .

Changelog:

[IOS] [FIXED] - Fixes Reject error kind in Fabric

Test Plan:

reject returns Error.

@facebook-github-botfacebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Dec 15, 2023
@analysis-bot

analysis-bot commented Dec 15, 2023

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a16,569,922-72,516
androidhermesarmeabi-v7an/a--
androidhermesx86n/a--
androidhermesx86_64n/a--
androidjscarm64-v8a19,951,036-87,388
androidjscarmeabi-v7an/a--
androidjscx86n/a--
androidjscx86_64n/a--

Base commit: aa2d613
Branch: main

@ryancat

Copy link
Copy Markdown
Contributor

This change exposed the original error instead of the one created from RCTJSErrorFromCodeMessageAndNSError. I am not sure if there's any side effect/implications of that.

It seems the RCTMakeError is merely a wrapper to the error message though.

cc @sammy-SC for more details on this.

@zhongwuzw
zhongwuzwforce-pushed the features/fix_reject_error_kind_fabric branch from 2d39b90 to 005a88dCompareJanuary 4, 2024 02:37

@cipolleschicipolleschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @zhongwuzw, thanks for the effort.
I think your changes mixes a little the semantic of the Error and lose some information from the ObjectiveC dictionary.
I suggested an approach that mixes what was happening before your changes with your suggestions.

You have the valid point of creating the Error, but I think it's better if we preserve the cause of the Error.
What do you think?

@zhongwuzw

Copy link
Copy Markdown
ContributorAuthor

@cipolleschi Please review again.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@zhongwuzw

Copy link
Copy Markdown
ContributorAuthor

@javache@cipolleschi Please review again. :)

@cipolleschicipolleschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks good to me. There is only a small nit.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-botfacebook-github-bot added the Merged This PR has been merged. label Jan 10, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi merged this pull request in 9525074.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.MergedThis PR has been merged.Shared with MetaApplied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS native module rejections are not instanceof Error

6 participants

@zhongwuzw@analysis-bot@ryancat@facebook-github-bot@javache@cipolleschi