From 71b3335de2f2f61c58e1925d2e73a65ce0b0831d Mon Sep 17 00:00:00 2001 From: jcasals <jcasals@iri.upc.edu> Date: Thu, 8 Aug 2019 12:30:20 +0200 Subject: [PATCH] Better error reporting for the YAML parser --- include/core/yaml/parser_yaml.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/core/yaml/parser_yaml.hpp b/include/core/yaml/parser_yaml.hpp index 87fb0e983..bb80d1952 100644 --- a/include/core/yaml/parser_yaml.hpp +++ b/include/core/yaml/parser_yaml.hpp @@ -386,7 +386,7 @@ void ParserYAML::parseFirstLevel(std::string file){ _paramsSens.push_back(pSensor); } } catch(YAML::InvalidNode& e){ - throw std::runtime_error("Error parsing sensors. Please make sure that each sensor entry has 'type' and 'name' entries."); + throw std::runtime_error("Error parsing sensors @" + generatePath(file) + ". Please make sure that each sensor entry has 'type' and 'name' entries."); } try{ for(const auto& kv : n_config["processors"]){ @@ -394,7 +394,7 @@ void ParserYAML::parseFirstLevel(std::string file){ _paramsProc.push_back(pProc); } } catch(YAML::InvalidNode& e){ - throw std::runtime_error("Error parsing processors. Please make sure that each processor has 'type', 'name' and 'sensor_name' entries."); + throw std::runtime_error("Error parsing processors @" + generatePath(file) + ". Please make sure that each processor has 'type', 'name' and 'sensor_name' entries."); } for(const auto& kv : n_config["callbacks"]){ _callbacks.push_back({{kv[0].as<std::string>(), kv[1].as<std::string>(), kv[2].as<std::string>()}}); -- GitLab