If an error was detected when selecting the winning particle, save the state of the samples and particles at that moment to help with debugging.
particle_select_err(subj, envir, err_cond)The index of the subject where the error was detected.
The enclosing environment of the function where the error occurred.
The original error condition that prompted this.