Skip to content

Commit aa19eb9

Browse files
authored
chore(autoware_map_projection_loader): show map error details (#10151)
* show map error details Signed-off-by: Y.Hisaki <yhisaki31@gmail.com> * use string stream Signed-off-by: Y.Hisaki <yhisaki31@gmail.com> --------- Signed-off-by: Y.Hisaki <yhisaki31@gmail.com>
1 parent b4d9155 commit aa19eb9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

map/autoware_map_projection_loader/src/load_info_from_lanelet2_map.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <lanelet2_io/Io.h>
2222
#include <lanelet2_projection/UTM.h>
2323

24+
#include <sstream>
2425
#include <string>
2526

2627
namespace autoware::map_projection_loader
@@ -31,7 +32,12 @@ autoware_map_msgs::msg::MapProjectorInfo load_info_from_lanelet2_map(const std::
3132
lanelet::projection::MGRSProjector projector{};
3233
const lanelet::LaneletMapPtr map = lanelet::load(filename, projector, &errors);
3334
if (!errors.empty()) {
34-
throw std::runtime_error("Error occurred while loading lanelet2 map");
35+
std::stringstream ss;
36+
ss << "Error occurred while loading lanelet2 map:\n";
37+
for (const auto & err : errors) {
38+
ss << "- " << err << "\n";
39+
}
40+
throw std::runtime_error(ss.str());
3541
}
3642

3743
// If the lat & lon values in all the points of lanelet2 map are all zeros,

0 commit comments

Comments
 (0)