Skip to content

Commit

Permalink
feat: more explicit error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-cochran committed Oct 11, 2023
1 parent bb3f1e8 commit 503e1f6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ const State StateBuilder::build(

if (subsetDetections == 0)
{
throw ostk::core::error::RuntimeError("Missing CoordinatesSubset");
throw ostk::core::error::RuntimeError("Missing CoordinatesSubset: [{}]", subset->getName());
}

if (subsetDetections > 1)
{
throw ostk::core::error::RuntimeError("Duplicate CoordinatesSubset");
throw ostk::core::error::RuntimeError("Duplicate CoordinatesSubset: [{}]", subset->getName());
}

if (Size(subsetCoordinates.size()) != subset->getSize())
Expand Down Expand Up @@ -216,7 +216,7 @@ const StateBuilder StateBuilder::expand(const Shared<const CoordinatesSubset>& a

if (this->coordinatesBrokerSPtr_->hasSubset(aCoordinatesSubsetSPtr))
{
throw ostk::core::error::RuntimeError("Duplicate CoordinatesSubset");
throw ostk::core::error::RuntimeError("Duplicate CoordinatesSubset: [{}]", aCoordinatesSubsetSPtr->getName());
}

Array<Shared<const CoordinatesSubset>> expandedSubsets = Array<Shared<const CoordinatesSubset>>::Empty();
Expand All @@ -238,7 +238,7 @@ const StateBuilder StateBuilder::contract(const Shared<const CoordinatesSubset>&

if (!this->coordinatesBrokerSPtr_->hasSubset(aCoordinatesSubsetSPtr))
{
throw ostk::core::error::RuntimeError("Missing CoordinatesSubset");
throw ostk::core::error::RuntimeError("Missing CoordinatesSubset: [{}]", aCoordinatesSubsetSPtr->getName());
}

Array<Shared<const CoordinatesSubset>> contractedSubsets = Array<Shared<const CoordinatesSubset>>::Empty();
Expand Down

0 comments on commit 503e1f6

Please sign in to comment.