Hacker News new | ask | show | jobs
by hcrean 943 days ago
They are attempting to argue that 404 is ambiguous, so we should avoid it. They do not to my eyes meaningfully highlight a replacement outside of some very specific cases.

I strongly disagree with this stance as I don't think 404 is ambiguous at all. Although it would be useful to know at what point in the broader hierarchy of a specific resource requested the unavailability starts: Ultimately 404 just means the specific 'tip of the spear' resource requested is not found.

2 comments

The thing about 404, is that you can both return 404 as well as an error document that has the structure the author is looking for, which means there is no reason why you can't return a 404 status.

Got 404, returned body is json, returned body is an error object, good to go.

Oh and, by returning a 404 you help intermediate caches know that they should not cache the response.

without 404, how will I force my collection of funny 404 images onto the world: https://tenor.com/view/dog-moon-moonlanding-landing-nasa-gif...