Skip to content

Preserve WinRT async error details in LocalBundleReader#16193

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-code-review-comment-16170
Draft

Preserve WinRT async error details in LocalBundleReader#16193
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-code-review-comment-16170

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 28, 2026

Description

Fixes a targeted review issue in LocalBundleReader::LoadBundleAsync: WinRT async failures were being converted to std::runtime_error, which can collapse diagnostics when surfaced through IAsyncOperation::get().

Type of Change

Erase all that don't apply.

  • Bug fix (non-breaking change which fixes an issue)

Why

LoadBundleAsync runs in a WinRT coroutine (IAsyncOperation<IBuffer>). Converting winrt::hresult_error to std::runtime_error in this path risks losing original WinRT error metadata/message at the async boundary.

What

  • Exception propagation
    • Replace std::runtime_error conversion with direct rethrow of the original WinRT exception.
  • Scope
    • Single-file, single-path change in /vnext/Microsoft.ReactNative/Utils/LocalBundleReader.cpp.
    • No behavioral changes outside async error propagation semantics.
catch (winrt::hresult_error const &) {
  throw;
}

Screenshots

N/A

Testing

No new tests were added for this scoped exception-handling adjustment.

Changelog

Should this change be included in the release notes: no

Preserve detailed WinRT async error information in LocalBundleReader::LoadBundleAsync by avoiding conversion to std::runtime_error.

Copilot AI changed the title [WIP] Fix code based on review comment from PR 16170 Fix: preserve winrt::hresult_error message in LocalBundleReader::LoadBundleAsync May 28, 2026
Copilot AI requested a review from JunielKatarn May 28, 2026 00:20
Copilot AI changed the title Fix: preserve winrt::hresult_error message in LocalBundleReader::LoadBundleAsync Preserve WinRT async error details in LocalBundleReader May 28, 2026
Copilot stopped work on behalf of JunielKatarn due to an error May 28, 2026 00:30
Copilot AI requested a review from JunielKatarn May 28, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants