From: Wolfgang Bangerth Date: Sun, 10 Sep 2023 16:20:03 +0000 (-0600) Subject: Improve an error message in IndexSet::get_view(). X-Git-Tag: relicensing~403^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16118%2Fhead;p=dealii.git Improve an error message in IndexSet::get_view(). --- diff --git a/source/base/index_set.cc b/source/base/index_set.cc index 383799cd9c..64c8b524d8 100644 --- a/source/base/index_set.cc +++ b/source/base/index_set.cc @@ -235,7 +235,13 @@ IndexSet::get_view(const size_type begin, const size_type end) const { Assert(begin <= end, ExcMessage("End index needs to be larger or equal to begin index!")); - Assert(end <= size(), ExcMessage("Given range exceeds index set dimension")); + Assert(end <= size(), + ExcMessage("You are asking for a view into an IndexSet object " + "that would cover the sub-range [" + + std::to_string(begin) + ',' + std::to_string(end) + + "). But this is not a subset of the range " + "of the current object, which is [0," + + std::to_string(size()) + ").")); IndexSet result(end - begin); std::vector::const_iterator r1 = ranges.begin();