diff options
author | Mark Spruiell <mes@zeroc.com> | 2011-06-06 13:18:17 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2011-06-06 13:18:17 -0700 |
commit | ea8288680e2caae80f0966ba16bde27ce57179fc (patch) | |
tree | ad22e7ec390bcac385cb2bf0f39f9852921d9404 /cpp/src/IceBox/ServiceManagerI.cpp | |
parent | bug 5128 - assertion failure in IceSSL transceiver (diff) | |
download | ice-ea8288680e2caae80f0966ba16bde27ce57179fc.tar.bz2 ice-ea8288680e2caae80f0966ba16bde27ce57179fc.tar.xz ice-ea8288680e2caae80f0966ba16bde27ce57179fc.zip |
minor cleanup to IceBox error handling and log messages
Diffstat (limited to 'cpp/src/IceBox/ServiceManagerI.cpp')
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.cpp | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index 1b6df99c482..414b858ee2f 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -265,13 +265,13 @@ IceBox::ServiceManagerI::stopService(const string& name, const Current&) catch(const Ice::Exception& ex) { Warning out(_logger); - out << "ServiceManager: exception in stop for service " << info.name << ":\n"; + out << "ServiceManager: exception while stopping service " << info.name << ":\n"; out << ex; } catch(...) { Warning out(_logger); - out << "ServiceManager: unknown exception in stop for service " << info.name; + out << "ServiceManager: unknown exception while stopping service " << info.name; } { @@ -599,16 +599,27 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint, { info.service = factory(_communicator); } + catch(const FailureException& ex) + { + throw; + } catch(const Exception& ex) { + ostringstream s; + s << "ServiceManager: exception in entry point `" + entryPoint + "' for service " << service << ":\n"; + s << ex; + FailureException e(__FILE__, __LINE__); - e.reason = "ServiceManager: exception in entry point `" + entryPoint + "': " + ex.ice_name(); + e.reason = s.str(); throw e; } catch(...) { + ostringstream s; + s << "ServiceManager: unknown exception in entry point `" + entryPoint + "' for service " << service; + FailureException e(__FILE__, __LINE__); - e.reason = "ServiceManager: unknown exception in entry point `" + entryPoint + "'"; + e.reason = s.str(); throw e; } @@ -700,7 +711,8 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint, catch(const Ice::Exception& ex) { Warning out(_logger); - out << "ServiceManager: exception in shutting down communicator for service " << service << ":\n"; + out << "ServiceManager: exception while shutting down communicator for service " << service + << ":\n"; out << ex; } @@ -712,7 +724,8 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint, catch(const Exception& ex) { Warning out(_logger); - out << "ServiceManager: exception in shutting down communicator for service " << service << ":\n"; + out << "ServiceManager: exception while destroying communicator for service " << service + << ":\n"; out << ex; } } @@ -736,6 +749,15 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint, e.reason = s.str(); throw e; } + catch(...) + { + ostringstream s; + s << "ServiceManager: unknown exception while starting service " << service; + + FailureException e(__FILE__, __LINE__); + e.reason = s.str(); + throw e; + } } void @@ -777,13 +799,13 @@ IceBox::ServiceManagerI::stopAll() catch(const Ice::Exception& ex) { Warning out(_logger); - out << "ServiceManager: exception in stop for service " << info.name << ":\n"; + out << "ServiceManager: exception while stopping service " << info.name << ":\n"; out << ex; } catch(...) { Warning out(_logger); - out << "ServiceManager: unknown exception in stop for service " << info.name; + out << "ServiceManager: unknown exception while stopping service " << info.name; } } } @@ -818,7 +840,7 @@ IceBox::ServiceManagerI::stopAll() catch(const Ice::Exception& ex) { Warning out(_logger); - out << "ServiceManager: exception in stop for service " << info.name << ":\n"; + out << "ServiceManager: exception while stopping service " << info.name << ":\n"; out << ex; } } @@ -836,13 +858,13 @@ IceBox::ServiceManagerI::stopAll() catch(const Exception& ex) { Warning out(_logger); - out << "ServiceManager: exception in stop for service " << info.name << ":\n"; + out << "ServiceManager: exception while stopping service " << info.name << ":\n"; out << ex; } catch(...) { Warning out(_logger); - out << "ServiceManager: unknown exception in stop for service " << info.name; + out << "ServiceManager: unknown exception while stopping service " << info.name; } if(info.communicator) @@ -855,7 +877,7 @@ IceBox::ServiceManagerI::stopAll() catch(const Exception& ex) { Warning out(_logger); - out << "ServiceManager: exception in stop for service " << info.name << ":\n"; + out << "ServiceManager: exception while stopping service " << info.name << ":\n"; out << ex; } } @@ -867,13 +889,13 @@ IceBox::ServiceManagerI::stopAll() catch(const Exception& ex) { Warning out(_logger); - out << "ServiceManager: exception in stop for service " << info.name << ":\n"; + out << "ServiceManager: exception while stopping service " << info.name << ":\n"; out << ex; } catch(...) { Warning out(_logger); - out << "ServiceManager: unknown exception in stop for service " << info.name; + out << "ServiceManager: unknown exception while stopping service " << info.name; } } @@ -886,7 +908,7 @@ IceBox::ServiceManagerI::stopAll() catch(const std::exception& ex) { Warning out(_logger); - out << "ServiceManager: unknown exception while destroying shared communicator:\n" << ex; + out << "ServiceManager: exception while destroying shared communicator:\n" << ex; } _sharedCommunicator = 0; } |