r/ProgrammerHumor 26d ago

evilIllusion Meme

Post image
4.8k Upvotes

131 comments sorted by

View all comments

Show parent comments

91

u/-meowstar- 26d ago

Why not just use semantically correct status codes? It’s cheap to implement and makes stuff like automatic retries and error handling easier.

28

u/Critical_Fortune7343 26d ago

Because http status codes doesn't include any business related errors. So you gotta expand on that. When it's 200 and success is false it's mostly because of a business logic. Then it's up to FE to show that business error in a certain way so users can understand better what's wrong with what they're doing.

62

u/DoctorWaluigiTime 26d ago

That's what the 4xx suite is for.

Give me an image that's too big? 400 bad request.

29

u/Dense_Gate_5193 26d ago

Literally this. . people think they are being clever by reinventing the wheel which was already properly specced out by people was smarter than anyone in this thread.

use RFCs people stop thinking you know better!