microsoft / libHttpClient

libHttpClient provides a platform abstraction layer for HTTP and WebSocket, and is designed for use by the Microsoft Xbox Live Service API (XSAPI) [https://github.com/Microsoft/xbox-live-api] and game devs. If you want to contribute to the project, please talk to us to avoid overlap.
MIT License
277 stars 126 forks source link

No platform error message on Microsoft platforms? #677

Open redbaron opened 2 years ago

redbaron commented 2 years ago

I noticed that Microsoft platforms return empty string from HCHttpCallResponseGetPlatformNetworkErrorMessage . I suppose platErrCode can be inspected somehow, but it's value is engine specific and will be different between XDK and GDK/WIN32. What is recommended way to get human readable error regardless of the platform?

image

jasonsandlin commented 2 years ago

Ya, its just for logging/debugging in case the platform sends a debug string. On those platforms, there's no string so its blank. If you want to convert HRESULTs to string for logging, then I would grab a function like this and put it somewhere in your codebase:

https://github.com/microsoft/DXUT/blob/main/Core/dxerr.cpp#L68

redbaron commented 2 years ago

This implies that I need to be platform aware in my code when using libhttpclient :(

jasonsandlin commented 2 years ago

Understood -- just leave this issue open and it'll be on our backlog. Not sure when we'll get to it, but I could see it being useful for folks

songguanqing commented 2 years ago

Is this library support Hololens2 ?