Open alex9smith opened 2 years ago
I've just released 1.4.0
which includes a check for API errors like the ones causing these and passes the error message from the API to the user which at least will be more helpful.
Still need to check over all the other query parameters and sort out better test coverage
There have been several recent bug reports (#11 , #15 , #17 ) where queries fail with the error
These are all because the query string is invalid and the API returns an error message. The
load_json
helper isn't handling this case correctly, and it returns a long integer and not a Python dictionary (possibly the Unicode representation of the error string).Then the line
if "articles" in articles:
fails because it's looking for a string in anint
.This isn't a great user experience.
The error message needs to be better when the query string is invalid.
I also need to address the root cause of these bugs - the library is generating invalid query strings. Test coverage of the various filter options is pretty poor at the moment so increasing that will hopefully find any remaining bugs.