gibbs_step_err function

Error handler for the gibbs_step call