Skip to content

Commit

Permalink
more verbose error message
Browse files Browse the repository at this point in the history
  • Loading branch information
tjfulle committed Jul 6, 2021
1 parent e69faa4 commit 27688fe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/tpetra/core/src/Tpetra_FECrsMatrix_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,13 @@ FECrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceLocalValuesImpl(
const LocalOrdinal numElts)
{
const char tfecfFuncName[] = "FECrsMatrix::replaceLocalValues: ";
TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC(
*fillState_ != FillState::open && *fillState_ != FillState::modify,
std::runtime_error,
"Cannot replace local values, matrix is not open to fill/modify. "
"The matrix is currently closed"
);
if (*fillState_ != FillState::open && *fillState_ != FillState::modify)
{
std::ostringstream errmsg;
errmsg << "Cannot replace local values, matrix is not open to fill/modify. "
<< "The matrix is currently closed";
TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC(true, std::logic_error, errmsg.str());
}
return crs_matrix_type::replaceLocalValuesImpl(rowVals, graph, rowInfo, inds, newVals, numElts);
}

Expand Down

0 comments on commit 27688fe

Please sign in to comment.