hrecht / censusapi

R package to retrieve U.S. Census data and metadata via API
https://www.hrecht.com/censusapi/
169 stars 31 forks source link

Add more robust error messaging for API key fails #4

Closed hrecht closed 7 years ago

hrecht commented 7 years ago

GetCensus function fails behind work proxies - error messages should make clearer what is happening and thus make it easier to troubleshoot and fix. Returning: "Error: lexical error: invalid char in json text." - it's really a proxy issue though.

hrecht commented 7 years ago

Update: this is actually an API key issue. Some APIs use Apache Tomcat HTML error messages rather than JSON errors. HTML response messages should get passed into R's console to help the user debug.

hrecht commented 7 years ago

Addressed with https://github.com/hrecht/censusapi/commit/5b1c291dcc342e3c271d69e10b6d77c10f329c63 Parse the HTML message in a future commit.