Commit 46ed367a authored by Joseph Mirabel's avatar Joseph Mirabel

Catch error when HPP server is not found.

parent 95dad16f
......@@ -132,7 +132,15 @@ namespace hpp {
hpp_ = new HppManipClient (0,0);
QByteArray iiop = getHppIIOPurl ().toLatin1();
QByteArray context = getHppContext ().toLatin1();
hpp_->connect (iiop.constData (), context.constData ());
try {
hpp_->connect (iiop.constData (), context.constData ());
} catch (const CosNaming::NamingContext::NotFound&) {
const char* msg = "Could not find the manipulation server. Is it running ?";
qDebug () << msg;
gepetto::gui::MainWindow* main = gepetto::gui::MainWindow::instance();
if (main != NULL)
main->logError(msg);
}
}
void HppManipulationWidgetsPlugin::closeConnection()
......
......@@ -271,7 +271,15 @@ namespace hpp {
hpp_ = new hpp::corbaServer::Client (0,0);
QByteArray iiop = getHppIIOPurl ().toLatin1();
QByteArray context = getHppContext ().toLatin1();
hpp_->connect (iiop.constData (), context.constData ());
try {
hpp_->connect (iiop.constData (), context.constData ());
} catch (const CosNaming::NamingContext::NotFound&) {
const char* msg = "Could not find the HPP server. Is it running ?";
qDebug () << msg;
gepetto::gui::MainWindow* main = gepetto::gui::MainWindow::instance();
if (main != NULL)
main->logError(msg);
}
}
void HppWidgetsPlugin::closeConnection ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment