]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Suppress exception output that is not very interesting. 16589/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 26 Jan 2024 16:59:19 +0000 (09:59 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 2 Feb 2024 18:55:13 +0000 (11:55 -0700)
source/base/exceptions.cc

index 5bdbd85462a4b30163a7dabcda43e430b2a9692c..b839b9ef8406a5f13d73cd5cae8cba451aa50645 100644 (file)
@@ -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;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.