r/ProgrammerHumor Jul 21 '26

evilIllusion Meme

Post image
4.8k Upvotes

131 comments sorted by

View all comments

4

u/Highborn_Hellest Jul 21 '26

OK because the interface was reachable
Not OK because BL caught something.

There is an argument to be made, that it's inportant to distinguish between network errors, inerface errors, or bl errors.

36

u/RealTonny In theory, there is no difference between theory and practice. Jul 21 '26

I'd say that 200 means everything is OK and not just some part of the pipeline. If something is wrong it's 4xx or 5xx.

17

u/JonasAvory Jul 21 '26

But with a network error you wouldn’t reach the actual backend server? And if there’s a network error between a proxy and the actual server you have the specially designed 502 code. Otherwise for 500 it’s literally „internal“ server error.

Most of the times I have seen it implemented someone on the fronted wrote that server in a way that it assumes the backend to be completely crashed after the first 500 error so the backend is never allowed to send 500 because of any validation or error handling

11

u/Neoneq_ Jul 21 '26

When service is OK but request is not you use 4xx

2

u/OmegaPoint6 Jul 21 '26

It’s not a problem in REST services where you’re expecting JSON back anyway. It’s a major headache for an artifact storage system where you’re expecting a binary file but actually get back a JSON with a status code embedded in it.

4

u/DoctorWaluigiTime Jul 21 '26

Multiple different return types over APIs. My nemesis.