2009-07-15 12:25:28 UTC
hi adedov,
I wrap the Client_base::execute() in one method and have try catch in it:
--------------------------------------------------------------------------------------------------
bool CSecManager::xmlRPCRequest(Client_base& client, const std::string& command, Param_list& param_list, Response& response)
{
try
{
client.set_keep_alive(true);
client.set_timeout(5);
response = client.execute(command, param_list); // may throw Exceptions
if (response.is_fault())
{
slog <<"XMLRPC: "<< command <<" <" << response.fault_code() <<">: " << response.fault_string() << endl;
return false;
}
} catch (const iqxmlrpc::Client_timeout& ct){
slog << "XMLRPC Exception: "<< command << " timeout error" << endl;
return false;
} catch (const iqnet::network_error& ne) {
slog << "XMLRPC Exception: "<< command << " network error" << endl;
return false;
} catch (...){
slog << "XMLRPC Exception: "<< command <<endl;
return false;
}
return true;
}
------------------------------------------------------------------------------------------------------------