Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into 'master'
[simgrid.git] / src / xbt / config.cpp
index c50e8057a1a4d3aff1ee02450aded19cf3b34635..e51a1ba34fa33890298ff4d7317aad001211023f 100644 (file)
@@ -307,7 +307,10 @@ inline ConfigurationElement* Config::get_dict_element(const std::string& name)
         XBT_INFO("Option %s has been renamed to %s. Consider switching.", name.c_str(), res->get_key().c_str());
       return res;
     } else {
-      throw std::out_of_range("Bad config key: " + name);
+      std::string msg = "Bad config key: " + name + "\nExisting config keys:\n";
+      for (auto const& elm : options)
+        msg += "  " + elm.first + ": (" + elm.second->get_type_name() + ")" + elm.second->get_string_value() + "\n";
+      throw std::out_of_range(msg);
     }
   }
 }