openverse-api
openverse-api copied to clipboard
UpstreamThumbnailException only raised when there are "ambiguous" problems and not for things outside the 2xx range
Description
Requests does not raise an exception if a link 404s, you have to check the status code or call raise_for_status on the response.
Reproduction
- See the response from `https://api-dev.openverse.engineering/v1/images/aaabb3e4-cbd9-4a55-b16f-634fd9d91483/thumb/` which should be 424ing is instead 404ing (check the actual status code of the response, not the response contents which currently relays the upstream issue).
Additional context
Noticed while testing the v2.5.11 release but did not stop the release because we're still no longer 500'ing.
Resolution
- [ ] 🙋 I would be interested in resolving this bug.
I could work on this, but can one guide me how to do it?
One more (slightly) related problem is that some items saved in the images table are actually audios (issue in the catalog: https://github.com/WordPress/openverse-catalog/issues/18). They return 406 errors when the front end requests a thumbnail.
Hello @dhruvkb . I would like work on this issue. Please assign me this
Hey @sourav25998, thank you for you interest in resolving this but @MustkimKhatik has previosuoy expressed an intention to address this issue. Could you please pick a different one? Thanks!
Hey @dhruvkb, we gotta change the landing URL as it broken for this but at the same time the error code should be 424 instead of 404. so can you please help me figuring out the current scenario here?