Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide error message if a cell path can't be determined #2812

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/geometry_aux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_ << "->";
Expand Down