TOutput: Add further parsers for errno-to-string conversion#2109
Merged
dcelasun merged 1 commit intoapache:masterfrom Apr 24, 2020
Merged
Conversation
Member
Author
|
The single error in Travis CI is unrelated. Please review? |
Member
|
Thanks for the PR @emmenlau! I'm not familiar with Windows or MSVC but this is at least harmless for other platforms so if nobody objects, I'll go ahead and merge this in 24 hours. |
janosvitok
approved these changes
Apr 23, 2020
Contributor
janosvitok
left a comment
There was a problem hiding this comment.
From quick look it seems ok.
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.
This change has mostly an impact on Windows. Currently Thrift does not resolve error strings on Windows (for me). A typical error message may look like
Could not bind: errno = 10049. With C++11 the newer formatting methodstrerror_s()is available on MSVC, however it fails to resolve many error messages. The most complete error handling on MSVC is possible only via Windows methods.This PR adds support for decoding error codes on MSVC via
FormatMessageA()into an ASCII string. In effect, above error id10049can be decoded asCould not bind: The requested address is not valid in its context.Furthermore, on platforms that do not have
strerror_ravailable (non-Posix systems), this PR turns tostrerror_sfrom C++11 to decode the message.[skip ci]at the end of your pull request to free up build resources.