1
0
Fork 0
forked from lthn/blockchain

epee: improved logs for abstract_tcp_server (warn about potential issue) and http_client (less drama when unable to connect)

This commit is contained in:
sowle 2019-11-12 11:30:27 +03:00
parent 2fd120f201
commit 470cde7948
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 12 additions and 3 deletions

View file

@ -254,7 +254,14 @@ class boosted_tcp_server
if(!ptr->call_handler())
return true;
}
catch(...) {
catch(std::exception& e)
{
LOG_ERROR("exeption caught in boosted_tcp_server::global_timer_handler: " << e.what() << ENDL << "won't be called anymore");
return true;
}
catch(...)
{
LOG_ERROR("unknown exeption caught in boosted_tcp_server::global_timer_handler, it won't be called anymore");
return true;
}

View file

@ -870,8 +870,10 @@ using namespace std;
if(!u_c.port)
u_c.port = 80;//default for http
res = tr.connect(u_c.host, static_cast<int>(u_c.port), timeout);
CHECK_AND_ASSERT_MES(res, false, "failed to connect " << u_c.host << ":" << u_c.port);
if (!tr.connect(u_c.host, static_cast<int>(u_c.port), timeout))
{
LOG_PRINT_L2("invoke_request: cannot connect to " << u_c.host << ":" << u_c.port);
}
}
return tr.invoke(u_c.uri, method, body, ppresponse_info, additional_params);