6 ms·
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 s
by benrutter 3y ago
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 https://dreamsongs.com/WorseIsBetter.html
- Izkata 3y agoWe 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.
- PH95VuimJjqBqy 3y agoThis 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.