Skip to content

Add missing error code mappings found in user visible errors - #41074

Merged
Feng Wang (chemwolf6922) merged 2 commits into
masterfrom
user/chemwolf6922/convert-numeric-errors-in-user-visible-error-to-string
Jul 15, 2026
Merged

Feng Wang (chemwolf6922) merged 2 commits into
masterfrom
user/chemwolf6922/convert-numeric-errors-in-user-visible-error-to-string

Conversation

@chemwolf6922

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Some error codes in user visible errors are not converted to human readable strings. For example:
Wsl/Service/CreateInstance/CreateVm/0x800705b4 should be Wsl/Service/CreateInstance/CreateVm/ERROR_TIMEOUT.

This PR adds mappings for missing error codes found in user visible error telemetries. And fixes the STATUS_SHUTDOWN_IN_PROGRESS mapping.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@chemwolf6922
Feng Wang (chemwolf6922) requested a review from a team as a code owner July 14, 2026 09:28
Copilot AI review requested due to automatic review settings July 14, 2026 09:28

Copilot AI 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.

Pull request overview

This PR improves user-visible error reporting by expanding the HRESULT→string mapping table so more telemetry/error paths render human-readable error identifiers (e.g., .../ERROR_TIMEOUT), and corrects an incorrect NTSTATUS mapping.

Changes:

  • Add HRESULT_FROM_NT(...) helper and switch STATUS_SHUTDOWN_IN_PROGRESS mapping to NTSTATUS-based conversion.
  • Expand g_commonErrors with additional Win32/HRESULT/NTSTATUS mappings (including ERROR_TIMEOUT).
  • Add missing NTSTATUS constant definitions to wdk.h used by the new mappings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/windows/inc/wdk.h Adds additional NTSTATUS constant definitions needed by error-string mapping.
src/windows/common/wslutil.cpp Extends the common error-code-to-string mapping table and fixes NTSTATUS conversion for shutdown-in-progress.

Comment thread src/windows/common/wslutil.cpp Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 10:21

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@chemwolf6922
Feng Wang (chemwolf6922) merged commit f0e42fa into master Jul 15, 2026
12 checks passed
@chemwolf6922
Feng Wang (chemwolf6922) deleted the user/chemwolf6922/convert-numeric-errors-in-user-visible-error-to-string branch July 15, 2026 02:35
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.

3 participants