diff options
Diffstat (limited to 'cpp/src/IceStorm/Service.cpp')
-rw-r--r-- | cpp/src/IceStorm/Service.cpp | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp index b6b1305d538..a6700d473a2 100644 --- a/cpp/src/IceStorm/Service.cpp +++ b/cpp/src/IceStorm/Service.cpp @@ -144,10 +144,17 @@ ServiceI::start( TransientTopicManagerImplPtr manager = new TransientTopicManagerImpl(_instance); _managerProxy = TopicManagerPrx::uncheckedCast(topicAdapter->add(manager, topicManagerId)); } - catch(const Ice::Exception&) + catch(const Ice::Exception& ex) { _instance = 0; - throw; + + ostringstream s; + s << "exception while starting IceStorm service " << name << ":\n"; + s << ex; + + IceBox::FailureException e(__FILE__, __LINE__); + e.reason = s.str(); + throw e; } topicAdapter->activate(); publishAdapter->activate(); @@ -163,10 +170,17 @@ ServiceI::start( _manager = new TopicManagerImpl(_instance); _managerProxy = TopicManagerPrx::uncheckedCast(topicAdapter->add(_manager->getServant(), topicManagerId)); } - catch(const Ice::Exception&) + catch(const Ice::Exception& ex) { _instance = 0; - throw; + + ostringstream s; + s << "exception while starting IceStorm service " << name << ":\n"; + s << ex; + + IceBox::FailureException e(__FILE__, __LINE__); + e.reason = s.str(); + throw e; } } else @@ -209,7 +223,7 @@ ServiceI::start( Ice::Error error(communicator->getLogger()); error << "deployment error: `" << topicManagerAdapterId << "' prefix does not match `" << nodeAdapterId << "'"; - throw "IceGrid deployment is incorrect"; + throw IceBox::FailureException(__FILE__, __LINE__, "IceGrid deployment is incorrect"); } // Determine the set of node id and node proxies. @@ -239,7 +253,7 @@ ServiceI::start( { Ice::Error error(communicator->getLogger()); error << "deployment error: `" << adapterid << "' does not start with `" << instanceName << "'"; - throw "IceGrid deployment is incorrect"; + throw IceBox::FailureException(__FILE__, __LINE__, "IceGrid deployment is incorrect"); } // The node id follows. We find the first digit (the @@ -262,7 +276,7 @@ ServiceI::start( Ice::Error error(communicator->getLogger()); error << "deployment error: node id does not follow instance name. instance name:" << instanceName << " adapter id: " << adapterid; - throw "IceGrid deployment is incorrect"; + throw IceBox::FailureException(__FILE__, __LINE__, "IceGrid deployment is incorrect"); } int nodeid = atoi(adapterid.substr(start, end-start).c_str()); @@ -280,7 +294,7 @@ ServiceI::start( { Ice::Error error(communicator->getLogger()); error << "Replication requires at least 3 Nodes"; - throw "error"; + throw IceBox::FailureException(__FILE__, __LINE__, "Replication requires at least 3 Nodes"); } try @@ -343,10 +357,17 @@ ServiceI::start( node->start(); } - catch(const Ice::Exception&) + catch(const Ice::Exception& ex) { _instance = 0; - throw; + + ostringstream s; + s << "exception while starting IceStorm service " << name << ":\n"; + s << ex; + + IceBox::FailureException e(__FILE__, __LINE__); + e.reason = s.str(); + throw e; } } @@ -378,10 +399,16 @@ ServiceI::start(const CommunicatorPtr& communicator, TransientTopicManagerImplPtr manager = new TransientTopicManagerImpl(_instance); _managerProxy = TopicManagerPrx::uncheckedCast(topicAdapter->add(manager, id)); } - catch(const Ice::Exception&) + catch(const Ice::Exception& ex) { _instance = 0; - throw; + ostringstream s; + s << "exception while starting IceStorm service " << name << ":\n"; + s << ex; + + IceBox::FailureException e(__FILE__, __LINE__); + e.reason = s.str(); + throw e; } } |