ropensci / taxize

A taxonomic toolbelt for R
https://docs.ropensci.org/taxize
Other
264 stars 58 forks source link

Wrapping raise_for_status() section with a try() statement #902

Closed bomeara closed 1 year ago

bomeara commented 1 year ago

Description

When using classification on many taxa, a rare Bad Request (HTTP 400) error would cause the code to stop.

Example

The following code would fail at random points before this PR; now, it announces the error and keeps going.

tiny <- downstream('Demospongiae', db='ncbi', downto="species")

This addresses issue https://github.com/ropensci/taxize/issues/901.

Note that I only addressed the classification.uid code; it's possible that similar changes would be useful in classification.tsn, classification.eolid, etc. I have silent=FALSE in the try statement, but perhaps silent=TRUE would be better.

zachary-foster commented 1 year ago

Thanks! I am on vacation, but I will take a look at this next week.

zachary-foster commented 1 year ago

looks good, thanks!