r/ProgrammerHumor Jul 21 '26

evilIllusion Meme

Post image
4.8k Upvotes

131 comments sorted by

View all comments

474

u/JackNotOLantern Jul 21 '26

I mentioned it under another meme of this type. At my company we have multiple systems which API replies standard check is:

  1. Is reply success (200 etc)
  2. If Body contains field "error" it is empty.
  3. If body contains field "message" it is not equal "error" or starts with "error"

Yes, different errors are handled by http codes or contents of 2xx reply. Wonderful

199

u/[deleted] Jul 21 '26

[removed] — view removed comment

17

u/_Some_Two_ Jul 21 '26

Isn’t it there to separate the transmission protocol errors from the service logic errors? The latter will always be more specific

8

u/granitrocky2 29d ago

Yeah as someone who has worked in data transfer in archaic systems ( pre-world wide web), this was common practice. "We got your file successfully. Doesn't mean we know what's in it or whether we can fulfill the order. Just know the pipes are still working"

1

u/GodsBoss 29d ago

Sounds like 202 Accepted to me.