Fix error message loss in IAsyncOperation by replacing std::runtime_error with winrt::hresult_error#16192
Draft
Copilot wants to merge 2 commits into
Draft
Fix error message loss in IAsyncOperation by replacing std::runtime_error with winrt::hresult_error#16192Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…to preserve error messages
Copilot
AI
changed the title
[WIP] Fix code based on review comment 3314246425
Fix error message loss in IAsyncOperation by replacing std::runtime_error with winrt::hresult_error
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Why
GetJavaScriptFromServerAsyncwas updated to returnwinrt::Windows::Foundation::IAsyncOperation<IBuffer>, but error paths still threwstd::runtime_error. C++/WinRT converts non-WinRT exceptions to a genericHRESULTwhen propagating failures throughIAsyncOperation::get(), silently dropping the detailed packager/HTTP error text that callers rely on for diagnostics.What
vnext/Shared/DevSupportManager.cpp/DevSupportManager.hGetJavaScriptFromServerAsyncreturn type fromstd::future<std::pair<std::string, bool>>toIAsyncOperation<IBuffer>PollForLiveReloadreturn type fromstd::future<HttpStatusCode>toIAsyncOperation<HttpStatusCode>throw std::runtime_error(error)in HRESULT failure path withthrow winrt::hresult_error(hr, winrt::to_hstring(error))— preserves both the original HRESULT code and messagethrow std::runtime_error(error)in HTTP error path withthrow winrt::hresult_error(E_FAIL, winrt::to_hstring(error))winrt::hresult_errorasstd::runtime_error, which downgraded the errorGetJavaScriptFromServerto unpack theIBufferresult and catchwinrt::hresult_errorfor error reporting#include <future>(no longer used)Before (error text lost at
.get()):After (error text preserved):
Screenshots
N/A
Testing
No new tests added; this is a targeted fix to error-propagation behavior in the WinRT async layer.
Changelog
Should this change be included in the release notes: no