iDigBio / ridigbio

ridigbio -- an R interface to iDigBio's API (see http://www.idigbio.org/)
http://idigbio.github.io/ridigbio/
Other
16 stars 10 forks source link

Update error message display for 400 errors #5

Closed mjcollin closed 9 years ago

mjcollin commented 9 years ago

Alex has updated the API to validate field names in rqs (and will be doing fields and fields_exclude soon). This makes 400 returns more likely and the output when they occur doesn't show his error message:

df <- idig_search_records(rq=list("asdf"="asdf"))
Error: HTTP failure: 400

vs

http://beta-search.idigbio.org/v2/search/?rq={%22asdf%22:%22asdf%22}
{
error: "Some of the query terms supplied were not found in the index",
context: {
asdf: false
},
name: "TermNotFoundException"
}