summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IcePack/Client.cpp')
-rw-r--r--cpp/src/IcePack/Client.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/cpp/src/IcePack/Client.cpp b/cpp/src/IcePack/Client.cpp
index b4df0a15a1e..0b70eb9a98c 100644
--- a/cpp/src/IcePack/Client.cpp
+++ b/cpp/src/IcePack/Client.cpp
@@ -48,6 +48,39 @@ Client::usage()
;
}
+class AdminExceptionFactory : public Ice::UserExceptionFactory
+{
+public:
+
+ virtual void createAndThrow(const string& type)
+ {
+ if(type == "::IcePack::DeploymentException")
+ {
+ throw DeploymentException();
+ }
+ else if(type == "::IcePack::ParserDeploymentException")
+ {
+ throw ParserDeploymentException();
+ }
+ else if(type == "::IcePack::AdapterDeploymentException")
+ {
+ throw AdapterDeploymentException();
+ }
+ else if(type == "::IcePack::OfferDeploymentException")
+ {
+ throw OfferDeploymentException();
+ }
+ else if(type == "::IcePack::ServerDeploymentException")
+ {
+ throw ServerDeploymentException();
+ }
+ }
+
+ virtual void destroy()
+ {
+ }
+};
+
int
Client::run(int argc, char* argv[])
{
@@ -151,6 +184,13 @@ Client::run(int argc, char* argv[])
return EXIT_FAILURE;
}
+ Ice::UserExceptionFactoryPtr factory = new AdminExceptionFactory;
+ communicator()->addUserExceptionFactory(factory, "::IcePack::DeploymentException");
+ communicator()->addUserExceptionFactory(factory, "::IcePack::ParserDeploymentException");
+ communicator()->addUserExceptionFactory(factory, "::IcePack::AdapterDeploymentException");
+ communicator()->addUserExceptionFactory(factory, "::IcePack::ServerDeploymentException");
+ communicator()->addUserExceptionFactory(factory, "::IcePack::OfferDeploymentException");
+
ParserPtr parser = Parser::createParser(communicator(), admin);
int status = EXIT_SUCCESS;