From afa42c2325b7788388246a67f0d8ae6faaae2830 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 26 Jan 2024 09:59:19 -0700 Subject: [PATCH] Suppress exception output that is not very interesting. --- source/base/exceptions.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/base/exceptions.cc b/source/base/exceptions.cc index 5bdbd85462..b839b9ef84 100644 --- a/source/base/exceptions.cc +++ b/source/base/exceptions.cc @@ -189,7 +189,13 @@ ExceptionBase::print_exc_data(std::ostream &out) const // condition, then output it. Not all exceptions do (e.g., when // creating an exception inside DEAL_II_NOT_IMPLEMENTED();), so // we have to check whether there is anything to print. - if (cond != nullptr) + // + // There are also places where the condition is not very interesting. + // Specifically, this is the case for places such as + // Assert (false, ExcInternalError()); + // Here, the condition is simply 'false'. This is not worth printing, + // so suppress this case. + if ((cond != nullptr) && (std::strcmp(cond, "false") != 0)) out << "The violated condition was: " << std::endl << " " << cond << std::endl; -- 2.39.5