diff options
Diffstat (limited to 'cpp/demo/IceStorm/clock/Publisher.cpp')
-rw-r--r-- | cpp/demo/IceStorm/clock/Publisher.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/demo/IceStorm/clock/Publisher.cpp b/cpp/demo/IceStorm/clock/Publisher.cpp index a148a85e94a..8686d797834 100644 --- a/cpp/demo/IceStorm/clock/Publisher.cpp +++ b/cpp/demo/IceStorm/clock/Publisher.cpp @@ -35,12 +35,18 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) return EXIT_FAILURE; } - IceStorm::TopicPrx topic = manager->retrieve("time"); - if (!topic) + IceStorm::TopicPrx topic; + try + { + topic = manager->retrieve("time"); + } + catch(const IceStorm::NoSuchTopic& e) { - cerr << argv[0] << ": No topic `time'" << endl; + cerr << argv[0] << ": NoSuchTopic: " << e.name << endl; return EXIT_FAILURE; + } + assert(topic); // // Get a publisher object, create a oneway proxy and then cast to |