News for hackers. Stuff that matters.
Re:Programming Is Hard by benrutter on Wednesday September 20, 2023 @07:34AM (#37582909)
This is so true. I see a lot of bad APIs and returning something like a 200 response + a message body saying something like "Psych! Actually it'd broken" is a surprisingly common anti-pattern.

Reminds me of Petet Gabriel's Worse Is Better[0], one of the insights of which is that it's often better to fail for edge cases than try to handle every single one.

[0] https://dreamsongs.com/WorseIsBetter.html

Re:Programming Is Hard by Izkata on Wednesday September 20, 2023 @10:06AM (#37584312)
We had to do this in order to show the user a relevant error message because our system is behind apache and it doesn't forward the content body from wsgi for (IIRC) whole classes of error codes.
Re:Programming Is Hard by PH95VuimJjqBqy on Wednesday September 20, 2023 @12:32PM (#37586303)
This particular thing is a matter of opinion, there are pro's and con's to each approach.

The question is what constitutes an error and should web semantics and application semantics align?

should I return a 404 on a missing record, and if I do, how can I differentiate between that and a routing error?

My point is that you're confidently stating something where both sides are neither right nor wrong, they simply value different things.