Skip to content

Commit

Permalink
Do not explode with empty tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bmagyar authored May 3, 2023
1 parent adb8897 commit 2f9a554
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hardware_interface/src/component_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <tinyxml2.h>
#include <charconv>
#include <iostream>
#include <regex>
#include <stdexcept>
#include <string>
Expand Down Expand Up @@ -68,7 +69,8 @@ std::string get_text_for_element(
const auto get_text_output = element_it->GetText();
if (!get_text_output)
{
throw std::runtime_error("text not specified in the " + tag_name + " tag");
std::cerr << "text not specified in the " << tag_name << " tag" << std::endl;
return "";
}
return get_text_output;
}
Expand Down

0 comments on commit 2f9a554

Please sign in to comment.