NCEAS / arcticdatautils

Utility functions in R for processing data for the Arctic Data Center
https://nceas.github.io/arcticdatautils/
Apache License 2.0
10 stars 20 forks source link

Error handling for get_orcid_name #157

Open dmullen17 opened 4 years ago

dmullen17 commented 4 years ago

get_orcid_name is a helper function called by list_submissions that attends to scrape an orcid url and return the submitter's name. It looks like this is failing in some cases and it could use some error handling so that it doesn't cause the function call to fail.

Here are examples of the two cases:

cn <- dataone::CNode('PROD')
adc <- dataone::getMNode(cn,'urn:node:ARCTIC')

list_submissions(adc, '2019-09-01', '2020-01-15') # this fails
list_submissions(adc, '2020-01-01', '2020-01-15') # this succeeds 

An easy way to do this would be to just include some text to default to if it fails like "Orcid not found".

@rachelsun97 if you want to take this one!