nnc: add plugin name to execution exception (#807)
authorVitaliy Cherepanov/AI Tools Lab /SRR/Engineer/삼성전자 <v.cherepanov@samsung.com>
Thu, 26 Jul 2018 14:30:30 +0000 (17:30 +0300)
committerSergey Vostokov/AI Tools Lab /SRR/Staff Engineer/삼성전자 <s.vostokov@samsung.com>
Thu, 26 Jul 2018 14:30:30 +0000 (23:30 +0900)
show plugin name on execution failed

Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
contrib/nnc/src/module/AbstractModule.cpp

index b80a396..32fb87e 100644 (file)
@@ -64,7 +64,15 @@ void *AbstractModule::execute(void *data) {
   if (_activePlugin == nullptr)
     throw ConfigException("Module <" + pluginTypeToStr(_moduleType) +
         "> has not been configured!");
-  return _activePlugin->getPluginInstance().execute(data);
+  void *result = nullptr;
+
+  try {
+    result = _activePlugin->getPluginInstance().execute(data);
+  } catch (nncc::foundation::Exception &e) {
+    e.append("Plugin <" + _activePlugin->getPluginName() + "> execution failed!");
+    throw;
+  }
+  return result;
 }
 
 contrib::plugin::PluginType AbstractModule::getModuleType() const { return _moduleType; }