From 411656668f4c3f35eb97046fcc309e619436e733 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 27 Dec 2023 08:44:48 -0600 Subject: [PATCH] Provide error message if a cell path can't be determined (#2812) --- src/geometry_aux.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/geometry_aux.cpp b/src/geometry_aux.cpp index 98dfc12a76..b0e88e8e36 100644 --- a/src/geometry_aux.cpp +++ b/src/geometry_aux.cpp @@ -544,6 +544,15 @@ std::string distribcell_path_inner(int32_t target_cell, int32_t map, } } + // if we get through the loop without finding an appropriate entry, throw + // an error + if (cell_it == search_univ.cells_.crend()) { + fatal_error( + fmt::format("Failed to generate a text label for distribcell with ID {}." + "The current label is: '{}'", + model::cells[target_cell]->id_, path.str())); + } + // Add the cell to the path string. Cell& c = *model::cells[*cell_it]; path << "c" << c.id_ << "->";