process_error loop