DataONEorg / rdataone

R package for reading and writing data at DataONE data repositories
http://doi.org/10.5063/F1M61H5X
36 stars 19 forks source link

getDataPackage should query the MN first not the CN #301

Open jeanetteclark opened 1 year ago

jeanetteclark commented 1 year ago

I'm not sure why this is, but getDataPackage will first try to query the CN and then fallback on the MN, see D1Client:520

Seems to me it would be better if this were reversed. Furthermore, if the query on line 521 fails, it won't even try to query the MN since that line of code will just error.

So, the solution is to replace the logic on line 520 so that the MN is queried, put the query in a try block, and if the try block fails, then try to find it on the CN.