I am currently using Boost Asio to connect to the server via TCP.
I use a conditional case to decide if the application should start or not connect to the server; It works fine, but the problem is that if I try to connect to the server when the server is down, the application error gives this error:
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >' what(): Connection refused
This is the code I'm using:
case CONNECTION:
I would like to save my application with its normal behavior and only raise a connection failure warning.
How can I handle this exception?
source share