diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-11-05 14:28:49 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-11-05 14:28:49 +0000 |
commit | e18f4e015ebb0a644cb686d36e68f2c73971989e (patch) | |
tree | 3be092484024917b74860b2cfd824ce77e8bb2be /cpp/src | |
parent | use Ice.ProgramName as a thread prefix (diff) | |
download | ice-e18f4e015ebb0a644cb686d36e68f2c73971989e.tar.bz2 ice-e18f4e015ebb0a644cb686d36e68f2c73971989e.tar.xz ice-e18f4e015ebb0a644cb686d36e68f2c73971989e.zip |
improved error handling in plug-in entry point
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceSSL/OpenSSLPluginI.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/cpp/src/IceSSL/OpenSSLPluginI.cpp b/cpp/src/IceSSL/OpenSSLPluginI.cpp index 74096530822..c6b4da8ca4e 100644 --- a/cpp/src/IceSSL/OpenSSLPluginI.cpp +++ b/cpp/src/IceSSL/OpenSSLPluginI.cpp @@ -68,19 +68,33 @@ create(const CommunicatorPtr& communicator, const string& name, const StringSeq& try { plugin->configure(); + + // + // Install the SSL endpoint factory + // + EndpointFactoryPtr sslEndpointFactory = new SslEndpointFactory(plugin); + facade->addEndpointFactory(sslEndpointFactory); } - catch (...) + catch(const Exception& ex) { Ice::PluginPtr ptr = plugin; // Reclaim the plug-in instance - // TODO: can't throw from an extern "C" function - // throw; + + Error out(communicator->getLogger()); + out << "exception in IceSSL plug-in:\n" << ex; + + // Can't throw from an extern "C" function + return 0; } + catch (...) + { + Ice::PluginPtr ptr = plugin; // Reclaim the plug-in instance + + Error out(communicator->getLogger()); + out << "unknown exception in IceSSL plug-in"; - // - // Install the SSL endpoint factory - // - EndpointFactoryPtr sslEndpointFactory = new SslEndpointFactory(plugin); - facade->addEndpointFactory(sslEndpointFactory); + // Can't throw from an extern "C" function + return 0; + } return plugin; } |