comparison plugin/PiperVampPluginFactory.cpp @ 1234:2d9e2771805a project-file-rework

Error handling
author Chris Cannam
date Thu, 27 Oct 2016 14:01:35 +0100
parents fac1666e429b
children 7f4230e7d83a
comparison
equal deleted inserted replaced
1233:fac1666e429b 1234:2d9e2771805a
146 piper_vamp::client::ProcessQtTransport transport(m_serverName, "capnp"); 146 piper_vamp::client::ProcessQtTransport transport(m_serverName, "capnp");
147 if (!transport.isOK()) { 147 if (!transport.isOK()) {
148 errorMessage = QObject::tr("Could not start external plugin host"); 148 errorMessage = QObject::tr("Could not start external plugin host");
149 return; 149 return;
150 } 150 }
151 151
152 piper_vamp::client::CapnpRRClient client(&transport); 152 piper_vamp::client::CapnpRRClient client(&transport);
153 piper_vamp::ListResponse lr = client.listPluginData(); 153 piper_vamp::ListResponse lr;
154
155 try {
156 lr = client.listPluginData();
157 } catch (piper_vamp::client::ServerCrashed) {
158 errorMessage = QObject::tr
159 ("External plugin host exited unexpectedly while listing plugins");
160 return;
161 }
154 162
155 for (const auto &pd: lr.available) { 163 for (const auto &pd: lr.available) {
156 164
157 QString identifier = 165 QString identifier =
158 QString("vamp:") + QString::fromStdString(pd.pluginKey); 166 QString("vamp:") + QString::fromStdString(pd.pluginKey);