From 4075747b41f9ff08ae61483219aadf88a9c6d4fa Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 13 Apr 2023 14:55:13 -0600 Subject: [PATCH] Better document ExcFunctionNonzeroReturn exception. --- include/deal.II/base/exceptions.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index 28745c7fc9..2b9a7c14a1 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -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. -- 2.39.5