You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no way to explicitly catch connection failures in client code. The implementation in client/client.cc intercepts exceptions during connect, by means of its ‘ExceptionPrinter’. This prints the exception on std::cout and leaves the PromiseHttp::Response in a limbo state, meaning the calling program cannot know what exactly went wrong. It can only rely on a default error state and a timeout.
For instance, if I run the http_client.cc example with a resource path starting with a local IP address that is serving nothing (e.g. http://127.0.0.1:4321). It will print: “Got exception: Could not connect: Resource temporarily unavailable” and then wait for the 5-second barrier timeout even though it is obvious that the request has already failed.
I have tried modifying the example by defining other handlers than Async::IgnoreException, but it makes no difference. I cannot manage to trigger a lambda that takes an exception_ptr, it is never invoked.
The text was updated successfully, but these errors were encountered:
There is no way to explicitly catch connection failures in client code. The implementation in client/client.cc intercepts exceptions during connect, by means of its ‘ExceptionPrinter’. This prints the exception on std::cout and leaves the PromiseHttp::Response in a limbo state, meaning the calling program cannot know what exactly went wrong. It can only rely on a default error state and a timeout.
For instance, if I run the http_client.cc example with a resource path starting with a local IP address that is serving nothing (e.g. http://127.0.0.1:4321). It will print: “Got exception: Could not connect: Resource temporarily unavailable” and then wait for the 5-second barrier timeout even though it is obvious that the request has already failed.
I have tried modifying the example by defining other handlers than Async::IgnoreException, but it makes no difference. I cannot manage to trigger a lambda that takes an exception_ptr, it is never invoked.
The text was updated successfully, but these errors were encountered: