diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-05-15 17:11:36 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-05-15 17:11:36 +0000 |
commit | 75317e3b65d2a2e08bf4190e352de2c248325791 (patch) | |
tree | 18377dd0dfccf30d6f17cbc5cae50b4cc4d07221 /cpp/src | |
parent | Win32 fix (diff) | |
download | ice-75317e3b65d2a2e08bf4190e352de2c248325791.tar.bz2 ice-75317e3b65d2a2e08bf4190e352de2c248325791.tar.xz ice-75317e3b65d2a2e08bf4190e352de2c248325791.zip |
Better error reporting if node fails to load server.
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceGrid/AdminI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceGrid/NodeCache.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceGrid/NodeI.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 15 |
4 files changed, 18 insertions, 15 deletions
diff --git a/cpp/src/IceGrid/AdminI.cpp b/cpp/src/IceGrid/AdminI.cpp index d3729784779..30490a10198 100644 --- a/cpp/src/IceGrid/AdminI.cpp +++ b/cpp/src/IceGrid/AdminI.cpp @@ -59,6 +59,10 @@ public: { ex.ice_throw(); } + catch(const Ice::UserException&) + { + throw; + } catch(const Ice::ObjectNotExistException&) { throw ServerNotExistException(_id); @@ -453,10 +457,6 @@ AdminI::startServer(const string& id, const Current&) { proxy->start(); } - catch(const ServerStartException&) - { - throw; - } catch(const Ice::Exception& ex) { proxy.handleException(ex); diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index be0f4d91f5d..f30af04da87 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -65,12 +65,10 @@ public: Ice::Trace out(_traceLevels->logger, _traceLevels->serverCat); out << "couldn't load `" << _id << "' on node `" << _node << "':\n" << ex.reason; } - - Ice::Warning out(_traceLevels->logger); - out << "failed to load `" + _id + "' on node `" << _node << "':\n" << ex << "\nreason: " << ex.reason; + ostringstream os; - os << ex << "\nreason: " << ex.reason; - _server->exception(NodeUnreachableException(_node, os.str())); + os << "couldn't load `" << _id << "' on node `" << _node << "':\n" << ex.reason; + _server->exception(DeploymentException(os.str())); } catch(const Ice::Exception& ex) { diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index dc2cea21190..f66d5882ad3 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -227,7 +227,7 @@ NodeI::loadServer_async(const AMD_Node_loadServerPtr& amdCB, } else { - if(server->getDescriptor()->applicationDistrib) + if(server->getDescriptor() && server->getDescriptor()->applicationDistrib) { removeServer(server); } diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 31b35facbeb..118275ba5da 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -1523,7 +1523,12 @@ ServerI::updateImpl(const string& application, const ServerDescriptorPtr& desc) _application = application; _desc = desc; - string user = _load->getDescriptor()->user; + if(!_desc) + { + return; + } + + string user = _desc->user; // // If the node is running as root and the user for the server @@ -1564,7 +1569,7 @@ ServerI::updateImpl(const string& application, const ServerDescriptorPtr& desc) } if(user != string(&buf[0])) { - throw "can't deploy `" + _id + "' under user account `" + user + "'"; + throw "couldn't load server under user account `" + user + "': feature not supported on Windows"; } #else // @@ -1573,7 +1578,7 @@ ServerI::updateImpl(const string& application, const ServerDescriptorPtr& desc) struct passwd* pw = getpwnam(user.c_str()); if(!pw) { - throw "can't deploy `" + _id + "' on node `" + _node->getName() + "': unknown user `" + user + "'"; + throw "unknown user `" + user + "'"; } // @@ -1582,9 +1587,9 @@ ServerI::updateImpl(const string& application, const ServerDescriptorPtr& desc) // running the node we throw, a regular user can't run a // process as another user. // - if(uid != 0 && _uid != uid) + if(uid != 0 && pw->pw_uid != uid) { - throw "can't deploy `" + _id + "' under user account `" + user + "': insufficient privileges"; + throw "node has insufficient privileges to load server under user account `" + user + "'"; } _uid = pw->pw_uid; |