diff options
Diffstat (limited to 'plugin.cpp')
-rw-r--r-- | plugin.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -60,13 +60,25 @@ bool PluginLoader::validate_config() for (const auto& site: sites) { for (const auto& path: site.paths) { - if (path.type == Plugin) { - std::string plugin {path.params.at("plugin")}; + // path must contain target and plugin + auto it {path.params.find("target")}; + if (it == path.params.end()) { + std::cout << "Path " << path.requested << " for site " << site.name << " is missing target specification." << std::endl; + return false; + } - if (!m_plugins.contains(plugin)) { - std::cout << "Configured plugin " << plugin << " not found" << std::endl; - return false; - } + it = path.params.find("plugin"); + if (it == path.params.end()) { + std::cout << "Path " << path.requested << " for site " << site.name << " is missing plugin specification." << std::endl; + return false; + } + + std::string plugin {it->second}; + + // check if plugin exists + if (!m_plugins.contains(plugin)) { + std::cout << "Configured plugin " << plugin << " not found" << std::endl; + return false; } } } |