Skip to content

Commit

Permalink
call GetLastError in arkProcessError
Browse files Browse the repository at this point in the history
  • Loading branch information
balos1 committed Dec 12, 2023
1 parent a2ed107 commit 7efa09f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/arkode/arkode.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "arkode_impl.h"
#include "arkode_interp_impl.h"
#include "sundials/priv/sundials_errors_impl.h"
#include "sundials/sundials_context.h"
#include "sundials/sundials_logger.h"
#include "sundials_utils.h"

Expand Down Expand Up @@ -3321,6 +3322,8 @@ int arkAccessHAdaptMem(void* arkode_mem, const char* fname, ARKodeMem* ark_mem,
void arkProcessError(ARKodeMem ark_mem, int error_code, int line,
const char* func, const char* file, const char* msgfmt, ...)
{
SUNFunctionBegin(ark_mem->sunctx);

/* Initialize the argument pointer variable
(msgfmt is the last required argument to arkProcessError) */
va_list ap;
Expand Down Expand Up @@ -3350,7 +3353,10 @@ void arkProcessError(ARKodeMem ark_mem, int error_code, int line,
}

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

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

Expand Down

0 comments on commit 7efa09f

Please sign in to comment.