Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reporting correct names for windows error codes #7885

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

kozlovsky
Copy link
Contributor

@kozlovsky kozlovsky commented Feb 5, 2024

This PR adds the correct exit code name reporting on Windows. For example, for the error code -1073741819, we should get the "STATUS_ACCESS_VIOLATION" name with this PR. In the future, it will also be possible to show more detailed error descriptions if necessary.

As it turns out, no available API or library maps Windows error codes to error names. It is possible to read the complete list of Windows error codes here: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55, but it is not available in a convenient way to use in an application code.

I parsed the list of errors and stored them as a file win_error_codes.txt. In this file, for each error we have a numeric code, an error name and a detailed description, separated by spaces. It was possible to use a more structured format, like JSON or CSV, but I prefer the plain text format as it is easy to parse and allows us to quickly see the diff if some errors will be added in the future.

@kozlovsky kozlovsky requested a review from drew2a February 5, 2024 13:23
@kozlovsky kozlovsky force-pushed the win_error_codes branch 2 times, most recently from 54c04fb to 297414e Compare February 5, 2024 14:03
@kozlovsky kozlovsky force-pushed the win_error_codes branch 3 times, most recently from 52b089a to 167dfdc Compare February 6, 2024 14:00
@kozlovsky kozlovsky marked this pull request as ready for review February 6, 2024 14:53
@kozlovsky kozlovsky requested a review from a team February 6, 2024 14:53
@kozlovsky kozlovsky merged commit 359c03a into Tribler:main Feb 6, 2024
20 checks passed
@kozlovsky kozlovsky deleted the win_error_codes branch February 6, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants