From a670a26d41264b0d6d12d3b5257ac154d7ae4bc7 Mon Sep 17 00:00:00 2001
From: Wolfgang Bangerth <bangerth@colostate.edu>
Date: Wed, 4 Oct 2023 20:51:10 -0600
Subject: [PATCH] Improve two error messages.

---
 include/deal.II/lac/affine_constraints.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/include/deal.II/lac/affine_constraints.h b/include/deal.II/lac/affine_constraints.h
index c46dda29b7..e683d2d8c4 100644
--- a/include/deal.II/lac/affine_constraints.h
+++ b/include/deal.II/lac/affine_constraints.h
@@ -1879,13 +1879,25 @@ public:
    *
    * @ingroup Exceptions
    */
-  DeclException0(ExcMatrixIsClosed);
+  DeclExceptionMsg(
+    ExcMatrixIsClosed,
+    "You are attempting an operation on an AffineConstraints object "
+    "that requires the object to be 'closed', i.e., for which you "
+    "needed to call the close() member function. But the object "
+    "is not currently closed, and so the operation can not be "
+    "performed.");
   /**
    * Exception
    *
    * @ingroup Exceptions
    */
-  DeclException0(ExcMatrixNotClosed);
+  DeclExceptionMsg(
+    ExcMatrixNotClosed,
+    "You are attempting an operation on an AffineConstraints object "
+    "that requires the object to not be 'closed', i.e., for which you "
+    "must not already have called the close() member function. But the "
+    "object is already closed, and so the operation can not be "
+    "performed.");
   /**
    * Exception
    *
-- 
2.39.5