Improve slice union not found error message

This commit is contained in:
Alejandro Gallo 2021-11-18 20:30:11 +01:00
parent 9f1f32e950
commit 54b568a669
2 changed files with 10 additions and 4 deletions

View File

@ -1453,8 +1453,11 @@ namespace atrip {
[&name](SliceUnion const* s) {
return name == s->name;
});
if (sliceUnionIt == unions.end())
throw std::domain_error("SliceUnion not found!");
if (sliceUnionIt == unions.end()) {
std::stringstream stream;
stream << "SliceUnion(" << name << ") not found!";
throw std::domain_error(stream.str());
}
return **sliceUnionIt;
}

View File

@ -552,8 +552,11 @@ namespace atrip {
[&name](SliceUnion const* s) {
return name == s->name;
});
if (sliceUnionIt == unions.end())
throw std::domain_error("SliceUnion not found!");
if (sliceUnionIt == unions.end()) {
std::stringstream stream;
stream << "SliceUnion(" << name << ") not found!";
throw std::domain_error(stream.str());
}
return **sliceUnionIt;
}