Skip to content

Commit 2f9a554

Browse files
authored
Do not explode with empty tag
1 parent adb8897 commit 2f9a554

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hardware_interface/src/component_parser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <tinyxml2.h>
1616
#include <charconv>
17+
#include <iostream>
1718
#include <regex>
1819
#include <stdexcept>
1920
#include <string>
@@ -68,7 +69,8 @@ std::string get_text_for_element(
6869
const auto get_text_output = element_it->GetText();
6970
if (!get_text_output)
7071
{
71-
throw std::runtime_error("text not specified in the " + tag_name + " tag");
72+
std::cerr << "text not specified in the " << tag_name << " tag" << std::endl;
73+
return "";
7274
}
7375
return get_text_output;
7476
}

0 commit comments

Comments
 (0)