summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/PluginManagerI.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2002-11-05 14:29:20 +0000
committerMark Spruiell <mes@zeroc.com>2002-11-05 14:29:20 +0000
commita7e3c206d7e4a0f3dde8ab43103836b09c69ec57 (patch)
tree1ee8424facfa61e61ddb739fec3dceb65964e8b3 /cpp/src/Ice/PluginManagerI.cpp
parentimproved error handling in plug-in entry point (diff)
downloadice-a7e3c206d7e4a0f3dde8ab43103836b09c69ec57.tar.bz2
ice-a7e3c206d7e4a0f3dde8ab43103836b09c69ec57.tar.xz
ice-a7e3c206d7e4a0f3dde8ab43103836b09c69ec57.zip
improved error handling for plug-in entry points
Diffstat (limited to 'cpp/src/Ice/PluginManagerI.cpp')
-rw-r--r--cpp/src/Ice/PluginManagerI.cpp30
1 files changed, 5 insertions, 25 deletions
diff --git a/cpp/src/Ice/PluginManagerI.cpp b/cpp/src/Ice/PluginManagerI.cpp
index 11b2416479b..a5cc108d04f 100644
--- a/cpp/src/Ice/PluginManagerI.cpp
+++ b/cpp/src/Ice/PluginManagerI.cpp
@@ -182,36 +182,16 @@ Ice::PluginManagerI::loadPlugin(const string& name, const string& entryPoint, co
}
//
- // Invoke the factory function.
+ // Invoke the factory function. No exceptions can be raised
+ // by the factory function because it's declared extern "C".
//
PLUGIN_FACTORY factory = (PLUGIN_FACTORY)sym;
- try
+ plugin = factory(_communicator, name, args);
+ if(!plugin)
{
- plugin = factory(_communicator, name, args);
- }
- catch(const Exception& ex)
- {
- //
- // Do NOT propagate the exception from the entry point,
- // because the library will be closed.
- //
- ostringstream out;
- out << "exception in entry point `" << entryPoint << "'\n"
- << "original exception:\n"
- << ex;
PluginInitializationException e(__FILE__, __LINE__);
- e.reason = out.str();
- throw e;
- }
- catch (...)
- {
- //
- // Do NOT propagate the exception from the entry point,
- // because the library will be closed.
- //
ostringstream out;
- out << "unknown exception in entry point `" << entryPoint << "'\n";
- PluginInitializationException e(__FILE__, __LINE__);
+ out << "failure in entry point `" << entryPoint << "'";
e.reason = out.str();
throw e;
}