From 694ebd2020ec19a31bc9a779c1032fd85fe7e4b9 Mon Sep 17 00:00:00 2001
From: Fabian Peller <fabian.peller-konrad@kit.edu>
Date: Thu, 12 Oct 2023 18:06:19 +0200
Subject: [PATCH] fixed error when searching for a specific skill

---
 .../provider/SkillProviderComponentPlugin.cpp      | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/source/RobotAPI/libraries/skills/provider/SkillProviderComponentPlugin.cpp b/source/RobotAPI/libraries/skills/provider/SkillProviderComponentPlugin.cpp
index cf20042c6..1a5b0b0d1 100644
--- a/source/RobotAPI/libraries/skills/provider/SkillProviderComponentPlugin.cpp
+++ b/source/RobotAPI/libraries/skills/provider/SkillProviderComponentPlugin.cpp
@@ -150,9 +150,19 @@ namespace armarx::plugins
         ARMARX_CHECK(skillId.isFullySpecified());
 
         const std::unique_lock l(skillFactoriesMutex);
-        if (skillFactories.find(skillId) != skillFactories.end())
+        if (skillFactories.find(skillId) == skillFactories.end())
         {
-            ARMARX_WARNING << "Skill description for skill '" + skillId.toString() + "' not found!";
+            std::stringstream ss;
+            ss << "Skill description for skill '" + skillId.toString() +
+                      "' not found! Found instead: {"
+               << "\n";
+            for (const auto& [k, _] : skillFactories)
+            {
+                ss << "\t" << k.toString() << "\n";
+            }
+            ss << "}";
+            ARMARX_WARNING << ss.str();
+
             return std::nullopt;
         }
 
-- 
GitLab