CenterOnBudget / getcensus

Load American Community Survey data from the U.S. Census Bureau API into Stata
https://centeronbudget.github.io/getcensus/
MIT License
14 stars 3 forks source link

Descriptive API error messages #2

Closed c-zippel closed 3 years ago

c-zippel commented 4 years ago

The program can't show descriptive error messages if the Census API does not return data, because it parses the JSON response as a delimited text file (and uses string functions to take out the brackets and quotes). Hence, if the API response is not parseable as a delimited text file (i.e. an error message is returned instead of data), then the resulting data will be empty and the program will exit (r(N) == 0). My proposed solution, short of changing how the program parses the JSON so it has more flexibility to pass on error messages from the Census, is to:

c-zippel commented 3 years ago

okay, unlike most APIs census doesn't return error messages in the JSON; they're in the header which Stata can't read. so best we can do is the options in bullets, both of which implemented in dev version

c-zippel commented 3 years ago

issue superceded by #37