Giphy / GiphyAPI

Public facing API docs, notes and more
1.9k stars 282 forks source link

Search endpoint intermittently returning only `message` attribute #229

Closed rushilshah1 closed 3 years ago

rushilshah1 commented 3 years ago

Intermittently receiving an error from /search endpoint where the response only contains a message attribute. Ex: https://api.giphy.com/v1/gifs/search?api_key=wZ2CjeQV98i63RYUZFaHxqGhE07FpZXs&limit=10&rating=g&offset=730&q=hi returned:

{
"message": "Failed to call RPC search"
}

There is no awareness in the API docs - please advise how developers should handle this

sergiop commented 3 years ago

@rushilshah1 it's ok that an error response has a different schema from the successful one. In my library, when the API sent a 4xx or 5xx error status like in your example, due to a bug it was treated as a successful response (200) and this blew up everything. But I fixed it with v1.5.1.