Skip to content

PromiseExtensions.Reject and InnerExceptions #1831

@btpnlsl

Description

@btpnlsl

I am looking into an error where LauncherModule.openURL is failing to open a URI because a native call to Launcher.LaunchUriAsync is throwing an exception for an unknown reason. Within openURL the exception is caught by a catch-block and the code is repackaging the exception within an InvalidOperationException before calling Promise.Reject.

In Promise.Reject (in PromiseExtensions.cs) the code is not pulling any info about the exceptions HResult or the InnerException, so all the information about why the native API failed is lost. I notice that this pattern of repackaging exceptions is used in a number of places.

At minimum RNW should not repackage exceptions if it is not providing the original exception information to Promise.Reject. Ideally RNW should also include HResult and InnerException in the Promise.Reject.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions