Skip to content

Commit

Permalink
call GetLastError in ProcessError
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 committed Dec 12, 2023
1 parent 71744b7 commit 7ddc5a7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cvodes/cvodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@

#include "cvodes_impl.h"
#include "sundials/priv/sundials_errors_impl.h"
#include "sundials/sundials_context.h"

/*=================================================================*/
/* CVODE Private Constants */
Expand Down Expand Up @@ -9907,6 +9908,8 @@ static int cvQuadSensRhs1InternalDQ(CVodeMem cv_mem, int is, sunrealtype t,
void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func,
const char* file, const char* msgfmt, ...)
{
SUNFunctionBegin(cv_mem->cv_sunctx);

/* Initialize the argument pointer variable
(msgfmt is the last required argument to cvProcessError) */
va_list ap;
Expand Down Expand Up @@ -9936,7 +9939,10 @@ void cvProcessError(CVodeMem cv_mem, int error_code, int line, const char* func,
}

/* Call the SUNDIALS main error handler */
SUNHandleErrWithMsg(line, func, file, msg, error_code, cv_mem->cv_sunctx);
SUNHandleErrWithMsg(line, func, file, msg, error_code, SUNCTX_);

/* Clear the last error value */
(void)SUNContext_GetLastError(SUNCTX_);
}
while (0);

Expand Down

0 comments on commit 7ddc5a7

Please sign in to comment.