diff --git a/include/cantera/base/Solution.h b/include/cantera/base/Solution.h index 136eca8ca..1ffe4c82a 100644 --- a/include/cantera/base/Solution.h +++ b/include/cantera/base/Solution.h @@ -115,8 +115,8 @@ public: //! Get the name of an adjacent phase by index string adjacentName(size_t i) const { - if (i < 0 || i >= m_adjacent.size()) { - throw CanteraError("Solution::adjacentName", "Invalid index {}.", i); + if (i >= m_adjacent.size()) { + throw IndexError("Solution::adjacentName", "m_adjacent", i, m_adjacent.size()-1); } return m_adjacent.at(i)->name(); }