Hacker News new | ask | show | jobs
by JoyrexJ9 1731 days ago
I do hope this is a humorous comment
2 comments

Why? The codes mean things, 418 specifically is a joke, but the entire 4xx range are client errors, i.e. a differently formed request would've succeeded.

A perhaps-reasonable suggestion could be to use a 5xx range code that isn't specified. E.g. 555, or 567.

(But I'm not sure how it would ever not simply be a 500 - server thought it couldn't happen, it could and did, that's just a plain and simple error isn't it?)

I think the idea behind 418, as much as there was an idea beyond a joke, was to indicate you sent your request to a teapot instead of a server. So yeah, client error for why it's not 518 instead.

But it works in this example for "client did something weird I don't understand", so still client error - something akin to a 404, "client tried to go somewhere I don't understand".

Yes, exactly, I wasn't excluding 418 in saying all 4xx are errors in the client's request.

But 'client did something weird I don't understand' is a 400, 405, something; not the same as 'this cannot happen' at all.

But it's the clients fault for trying to communicate with a teapot. There's nothing wrong inside the teapot. You just tried to communicate with a teapot. That's silly. Here's a 418 for you.
Again, yes, I am not saying 418 is wrong to be 4xx, I am including it in 'the entire 4xx range are client errors'.
I would be extremely disappointed if a 555 error didn't have something to do with bad timing.
400 series codes are for client errors. 500 series codes are for server errors.