diff src/plugincandidates.cpp @ 13:8545be78b994

OSX build fixes and logic
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 25 Oct 2016 14:48:56 +0100
parents 92e72014d979
children 8643d4d1cb14
line wrap: on
line diff
--- a/src/plugincandidates.cpp	Tue Oct 18 13:14:55 2016 +0100
+++ b/src/plugincandidates.cpp	Tue Oct 25 14:48:56 2016 +0100
@@ -150,7 +150,18 @@
     process.setProcessChannelMode(QProcess::ForwardedErrorChannel);
     process.start(m_helper.c_str(), { descriptor.c_str() });
     if (!process.waitForStarted()) {
-	cerr << "helper failed to start" << endl;
+        QProcess::ProcessError err = process.error();
+        if (err == QProcess::FailedToStart) {
+            std::cerr << "Unable to start helper process " << m_helper
+                      << std::endl;
+        } else if (err == QProcess::Crashed) {
+            std::cerr << "Helper process " << m_helper
+                      << " crashed on startup" << std::endl;
+        } else {
+            std::cerr << "Helper process " << m_helper
+                      << " failed on startup with error code "
+                      << err << std::endl;
+        }
 	throw runtime_error("plugin load helper failed to start");
     }
     for (auto &lib: libraries) {
@@ -196,7 +207,9 @@
         process.close();
         process.waitForFinished();
     }
-	
+
+    log("helper completed");
+    
     return output;
 }