If an error was detected when generating new samples. Save the state of the samples and particles at that moment to help with debugging.
new_sample_err(pmwgs, envir, err_cond)The pmwgs object for the current run.
The environment of the function at this point in time.
The original error condition that prompted this.