summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/NodeI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/NodeI.cpp')
-rw-r--r--cpp/src/IceGrid/NodeI.cpp40
1 files changed, 15 insertions, 25 deletions
diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp
index b796dab7d78..3a74ae62e45 100644
--- a/cpp/src/IceGrid/NodeI.cpp
+++ b/cpp/src/IceGrid/NodeI.cpp
@@ -586,11 +586,11 @@ NodeI::patch_async(const AMD_Node_patchPtr& amdCB,
{
if(running.size() == 1)
{
- throw "server `" + toString(running) + "' is active";
+ throw runtime_error("server `" + toString(running) + "' is active");
}
else
{
- throw "servers `" + toString(running, ", ") + "' are active";
+ throw runtime_error("servers `" + toString(running, ", ") + "' are active");
}
}
@@ -609,7 +609,7 @@ NodeI::patch_async(const AMD_Node_patchPtr& amdCB,
icepatch = FileServerPrx::checkedCast(_communicator->stringToProxy(appDistrib->icepatch));
if(!icepatch)
{
- throw "proxy `" + appDistrib->icepatch + "' is not a file server.";
+ throw runtime_error("proxy `" + appDistrib->icepatch + "' is not a file server.");
}
patch(icepatch, "distrib/" + application, appDistrib->directories);
}
@@ -625,7 +625,7 @@ NodeI::patch_async(const AMD_Node_patchPtr& amdCB,
icepatch = FileServerPrx::checkedCast(_communicator->stringToProxy(dist->icepatch));
if(!icepatch)
{
- throw "proxy `" + dist->icepatch + "' is not a file server.";
+ throw runtime_error("proxy `" + dist->icepatch + "' is not a file server.");
}
patch(icepatch, "servers/" + (*s)->getId() + "/distrib", dist->directories);
@@ -636,19 +636,9 @@ NodeI::patch_async(const AMD_Node_patchPtr& amdCB,
}
}
}
- catch(const Ice::LocalException& e)
+ catch(const exception& ex)
{
- ostringstream os;
- os << e;
- failure = os.str();
- }
- catch(const string& e)
- {
- failure = e;
- }
- catch(const char* e)
- {
- failure = e;
+ failure = ex.what();
}
for(set<ServerIPtr>::const_iterator s = servers.begin(); s != servers.end(); ++s)
@@ -1078,10 +1068,10 @@ NodeI::removeServer(const ServerIPtr& server, const std::string& application)
{
IcePatch2Internal::removeRecursive(appDir);
}
- catch(const string& msg)
+ catch(const exception& ex)
{
Ice::Warning out(_traceLevels->logger);
- out << "removing application directory `" << appDir << "' failed:\n" << msg;
+ out << "removing application directory `" << appDir << "' failed:\n" << ex.what();
}
}
}
@@ -1117,10 +1107,10 @@ NodeI::checkConsistencyNoSync(const Ice::StringSeq& servers)
{
contents = readDirectory(_serversDir);
}
- catch(const string& msg)
+ catch(const exception& ex)
{
Ice::Error out(_traceLevels->logger);
- out << "couldn't read directory `" << _serversDir << "':\n" << msg;
+ out << "couldn't read directory `" << _serversDir << "':\n" << ex.what();
return commands;
}
@@ -1156,7 +1146,7 @@ NodeI::checkConsistencyNoSync(const Ice::StringSeq& servers)
Ice::Error out(_traceLevels->logger);
out << "server `" << *p << "' destroy failed:\n" << ex;
}
- catch(const string&)
+ catch(const exception&)
{
assert(false);
}
@@ -1175,10 +1165,10 @@ NodeI::checkConsistencyNoSync(const Ice::StringSeq& servers)
continue;
}
}
- catch(const string& msg)
+ catch(const exception& ex)
{
Ice::Warning out(_traceLevels->logger);
- out << "removing server directory `" << _serversDir << "/" << *p << "' failed:\n" << msg;
+ out << "removing server directory `" << _serversDir << "/" << *p << "' failed:\n" << ex.what();
}
*p = _serversDir + "/" + *p;
@@ -1260,7 +1250,7 @@ NodeI::canRemoveServerDirectory(const string& name)
return false;
}
}
- catch(const string&)
+ catch(const exception&)
{
return false;
}
@@ -1284,7 +1274,7 @@ NodeI::canRemoveServerDirectory(const string& name)
return false;
}
}
- catch(const string&)
+ catch(const exception&)
{
return false;
}