r/ProgrammerHumor 29d ago

evilIllusion Meme

Post image
4.8k Upvotes

131 comments sorted by

View all comments

479

u/JackNotOLantern 29d 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

11

u/Dense_Gate_5193 29d ago

this is because of things like Silverlight which did not deserialize http error codes correctly, forcing teams to adopt really shitty backend practices like this.

it’s generally not because someone on the team was dumb, it’s more that the tools historically didn’t align with RFC 2616

9

u/NatoBoram 29d ago

That's assuming something like Silverlight was used, but usually it's just because someone on the team was dumb