You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by GitBox <gi...@apache.org> on 2020/04/22 15:47:31 UTC

[GitHub] [thrift] emmenlau opened a new pull request #2109: TOutput: Add further parsers for errno-to-string conversion

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:
users@infra.apache.org



[GitHub] [thrift] dcelasun commented on pull request #2109: TOutput: Add further parsers for errno-to-string conversion

Posted by GitBox <gi...@apache.org>.
dcelasun commented on pull request #2109:
URL: https://github.com/apache/thrift/pull/2109#issuecomment-618673933


   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.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [thrift] emmenlau commented on pull request #2109: TOutput: Add further parsers for errno-to-string conversion

Posted by GitBox <gi...@apache.org>.
emmenlau commented on pull request #2109:
URL: https://github.com/apache/thrift/pull/2109#issuecomment-618667684


   The single error in Travis CI is unrelated. Please review?


----------------------------------------------------------------
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:
users@infra.apache.org