changeset 129:7a7a46d4bd3c

Fail explicitly if a nonexistent plugin output is requested
author Chris Cannam
date Fri, 10 Oct 2014 15:00:47 +0100
parents c24270fc6635
children 65dabaebe604
files runner/FeatureExtractionManager.cpp
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/runner/FeatureExtractionManager.cpp	Thu Oct 09 13:18:06 2014 +0100
+++ b/runner/FeatureExtractionManager.cpp	Fri Oct 10 15:00:47 2014 +0100
@@ -343,6 +343,15 @@
         if (transform.getOutput() == "") {
             transform.setOutput
                 (plugin->getOutputDescriptors()[0].identifier.c_str());
+        } else {
+            if (m_pluginOutputs[plugin].find
+                (transform.getOutput().toLocal8Bit().data()) ==
+                m_pluginOutputs[plugin].end()) {
+                cerr << "ERROR: Transform requests nonexistent plugin output \""
+                     << transform.getOutput()
+                     << "\"" << endl;
+                return false;
+            }
         }
 
         m_transformPluginMap[transform] = plugin;
@@ -663,8 +672,9 @@
             string outputId = transform.getOutput().toStdString();
             if (m_pluginOutputs[plugin].find(outputId) ==
                 m_pluginOutputs[plugin].end()) {
-                //!!! throw?
-                cerr << "WARNING: Nonexistent plugin output \"" << outputId << "\" requested for transform \""
+                // We shouldn't actually reach this point:
+                // addFeatureExtractor tests whether the output exists
+                cerr << "ERROR: Nonexistent plugin output \"" << outputId << "\" requested for transform \""
                      << transform.getIdentifier().toStdString() << "\", ignoring this transform"
                      << endl;
 /*