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:
parent
2fd120f201
commit
470cde7948
2 changed files with 12 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue