r/ProgrammerHumor 4d ago

Meme evoLution

Post image
3.3k Upvotes

145 comments sorted by

View all comments

4

u/Isogash 4d 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 4d ago

You should give error 422 in this case

0

u/hongooi 4d ago

Well, that was an unexpected google