Me: We should change the http response code to anything but 200 OK in the error response case of our API.
Other dev: No, it's fine.
Me: Why?
Other dev: The client successfully receives an error message.
Me: ┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻

  • 9
    That is not how 200 is supposed to be used T_T
  • 4
    I like your ascii smiley
  • 5
    ++ for smiley
  • 8
    The people who send error in status 200 should burn in a 200^hell.
  • 3
    002, NOT OK
  • 4
    res.body === { success: "false" } // true
    res.status === 200 // true

    I have to consume a few APIS like this at my job
  • 1
    I’ve had to argue this with other devs before.

    In the end “management” got involved and told us it should stay as 200 because the client consumes the API and we can’t possibly make our product better if it impacts the client in any way at all.
  • 0
    @Brolls hence why you version your apis such as /v1/makedumbdumb && /v2/makedumbdumb
  • 1
    @perotti that sadly was not an option either, the client said they didn’t want to have to change endpoints etc.

    Basically they had a fucked up power over our company, and anything they said went pretty much.
  • 2
    @Brolls time to ditch the company then lol. This is why robots are no threats, managers will get robots to destroy themselves with paradoxes
  • 3
    @perotti haha. I did end up leaving 👍
  • 0
    My product had to integrate with another internal service that registers machine names. One guy wrote and maintains it.

    200 return every fucking time! 🤦‍♀️
  • 1
    I used to have this mindset. I found "actual" errors to be this mysterious bottom-level thing and if you could intercept a division by zero and abort it, it was no longer an error.

    Come to think about it, error handling is one of the aspects I enjoy the most about development. It's oddly satisfying when you make what would be a breaking change but that check that you wrote two months ago gotchu and makes it a trivial fix.
  • 0

    Awesome song !!
  • 1
Add Comment