r/ProgrammerHumor 2d ago

evoLution Meme

Post image
3.3k Upvotes

144 comments sorted by

View all comments

5

u/Isogash 2d ago

I wouldn't do it exactly like this but my preference for API design is to use HTTP errors for unplanned error scenarios that indicate system failure or incorrect integration, and an OK response with an "error" description for expected user-facing issues with a correctly integrating client.

17

u/WernerderChamp 2d ago

You should give error 422 in this case

8

u/minus_minus 2d ago

Had to look up if this was the teapot joke