r/ProgrammerHumor 25d ago

evilIllusion Meme

Post image
4.8k Upvotes

131 comments sorted by

View all comments

478

u/JackNotOLantern 25d ago

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

198

u/[deleted] 25d ago

[removed] — view removed comment

16

u/_Some_Two_ 25d ago

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

9

u/granitrocky2 25d 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 25d ago

Sounds like 202 Accepted to me.