emmenlau opened a new pull request #2109:
URL: https://github.com/apache/thrift/pull/2109


   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 method 
`strerror_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 id `10049` can be decoded as 
`Could not bind: The requested address is not valid in its context`.
   
   Furthermore, on platforms that do not have `strerror_r` available (non-Posix 
systems), this PR turns to `strerror_s` from C++11 to decode the message.
   
   - [ ] Did you create an [Apache 
Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket?  (not 
required for trivial changes)
   - [ ] If a ticket exists: Does your pull request title follow the pattern 
"THRIFT-NNNN: describe my issue"?
   - [x] Did you squash your changes to a single commit?  (not required, but 
preferred)
   - [x] Did you do your best to avoid breaking changes?  If one was needed, 
did you label the Jira ticket with "Breaking-Change"?
   - [x] If your change does not involve any code, add ` [skip ci]` at the end 
of your pull request to free up build resources.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to