3 ms·
Tbf, 500 is the appropriate error message for user has broken the server.
by bawolff 3y ago
Tbf, 500 is the appropriate error message for user has broken the server.
- jeroenhd 3y ago5xx means the server messed up, if the user should've done something different you'd see a 4xx error. A good web server validates the user input, throws a 4xx error if the input is bad for the current state, and if something still goes wrong (which is a server bug) the 5xx range becomes appropriate.
- david422 3y agoThat's what he just said though. User breaks the server is a 500. Server prevents the user from breaking the server is a 400.
- jeroenhd 3y agoBut a 500 isn't the user breaking the server, it's the server being broken before the user ever came in. Users and client software cannot (or rather, should never) be held responsible for 500 error codes, which "user breaks the server" implies.
- bawolff 3y ago400 is a client error. 500 is server error. A server error induced by a client action (e.g. triggering an unexpected exception) is still a server error.