Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

name_usage(key, data = "iucnRedListCategory") returns Error for some keys instead of an empty tibble #667

Open
olehprylutskyi opened this issue Aug 4, 2023 · 1 comment
Labels

Comments

@olehprylutskyi
Copy link

olehprylutskyi commented Aug 4, 2023

name_usage(key, data = "iucnRedListCategory") returns

Error: Status: 204 - not found

for some keys instead of an empty tibble, in contrast to how name_usage() behaves, for instance, with “synonyms” or "children" data parameter. This aborts any loops once Error is encountered and prevents looking up for IUCN RL category for a vector of taxonKeys.

Example:
name_usage(key = 7190896, data = "iucnRedListCategory")$data

Error: Status: 204 - not found

Compare with
name_usage(key = 7190896, data = "children")$data

A tibble: 0 × 0

@jhnwllr
Copy link
Collaborator

jhnwllr commented Aug 30, 2023

This seems to have more to do with how the GBIF API works rather than with rgbif. There isn't really an easy fix, and I think I would rather push for the GBIF API to return no results rather than a 204 warning.

https://api.gbif.org/v1/species/7190896/iucnRedListCategory

In the mean time you can wrap name_usage calls in a try statement to avoid getting the error.

gbif/gbif-api#108

@jhnwllr jhnwllr removed this from the 3.7.8 milestone Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants