cyclotron3k / flickr

A Ruby client for the Flickr API
MIT License
14 stars 2 forks source link

HTML style response #5

Open rctneil opened 1 year ago

rctneil commented 1 year ago

Hey,

How can I deal with this situation?

https://www.flickr.com/groups/api/discuss/72157721918336667/

cyclotron3k commented 1 year ago

Hi @rctneil - is there more to the error message? It's difficult to tell if it's a rate limiting error, or just a 500 from Flickr's servers falling over

cyclotron3k commented 1 year ago

The gem doesn't raise a "Flickr::FailedResponse" error when it receives HTML instead of JSON from Flickr's server; it's raising a "JSON::ParserError", so, for now, you'll need to rescue that as well.

I'm interested to find out why we're getting HTML instead of JSON, and I think we should handle unexpected HTML better.

cyclotron3k commented 1 year ago

@rctneil Do you have more information on how you were able to trigger this issue? Were you hitting API limits, or maybe requesting resources that don't exist?