]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Better document ExcFunctionNonzeroReturn exception. 15098/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 13 Apr 2023 20:55:13 +0000 (14:55 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 13 Apr 2023 20:55:13 +0000 (14:55 -0600)
include/deal.II/base/exceptions.h

index 28745c7fc93039f28af872713016a3db1cc21800..2b9a7c14a1796b0b6cbb4358cf996267a2bb4c1f 100644 (file)
@@ -863,10 +863,17 @@ namespace StandardExceptions
   /**
    * This exception is used if some user function returns nonzero exit codes.
    */
-  DeclException2(ExcFunctionNonzeroReturn,
-                 std::string,
-                 int,
-                 << "Function \"" << arg1 << "\" returned " << arg2);
+  DeclException2(
+    ExcFunctionNonzeroReturn,
+    std::string,
+    int,
+    << "The function \"" << arg1 << "\" returned the nonzero value " << arg2
+    << ", but the calling site expected the return value to be zero. "
+       "This error often happens when the function in question is a 'callback', "
+       "that is a user-provided function called from somewhere within deal.II "
+       "or within an external library such as PETSc, Trilinos, SUNDIALS, etc., "
+       "that expect these callbacks to indicate errors via nonzero return "
+       "codes.");
 
   /**
    * This exception is used if some object is found uninitialized.

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.