From: Wolfgang Bangerth Date: Fri, 26 Jan 2024 16:59:19 +0000 (-0700) Subject: Suppress exception output that is not very interesting. X-Git-Tag: relicensing~74^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afa42c2325b7788388246a67f0d8ae6faaae2830;p=dealii.git Suppress exception output that is not very interesting. --- 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;