NativeCommandExitException should display "negative" exit codes in hex, not decimal
See original GitHub issuePrerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
When a native command exits with a “negative” (high-order bit set) exit code, PowerShell 7.4.0-preview.4 displays something like:
NativeCommandExitException: Program "winget.exe" ended with non-zero exit code: -1978335212.
This negative value cannot (really) be made sense of unless you convert it to hex (0x8a150014
in that case).
Expected behavior
NativeCommandExitException: Program "winget.exe" ended with non-zero exit code: 0x8a150014.
Actual behavior
NativeCommandExitException: Program "winget.exe" ended with non-zero exit code: -1978335212.
Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.4.0-preview.4
PSEdition Core
GitCommitId 7.4.0-preview.4
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Issue Analytics
- State:
- Created 3 months ago
- Comments:28 (11 by maintainers)
Top Results From Across the Web
NativeCommandExitException should display "negative ...
NativeCommandExitException should display "negative" exit codes in hex, not decimal #24105 · Summary ...
Read more >Convert negative signed in error number to standard ...
I have a vague memory of reading about a way to convert error numbers from a format like this -1073740791 to something meaningful....
Read more >Format Exit Code - Reporting
I would like to display the exit code in a useful way. ... as integer) as hexadecimal and display the converted exit code...
Read more >Tridion Docs: Converting a negative decimal error number to ...
Open Windows calculator and set it to the programmers view. Select decimal (DEC) and paste the value. Now switch to hexadecimal (HEX) and...
Read more >How to analyze/translate "exit status" - visual studio
Based on my research, most of exit code is like 0xE0434352 . What's their difference? Hexadecimal or decimal? How can I convert -532462766...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The Engine WG reviewed this issue and agrees with @Luiz-Monad. The message can easily be updated to display the int
ExitCode
in both decimal and hexadecimal.There’s no true correct answer for this situation, really.
So I propose:
NativeCommandExitException: Program "winget.exe" ended with non-zero exit code: -1978335212 (0x8a150014).
Why not both !