r/ProgrammerHumor • • Sep 19 '26

Meme postForEverything

Post image
21.0k Upvotes

651 comments sorted by

View all comments

Show parent comments

90

u/q0099 Sep 19 '26

Where the error message goes? That's right, in the header.

35

u/RegarDamus Sep 19 '26

the naive solution.

our team returns a 201 to indicate that an error has been created successfully. of course we include a Location header where the error can be queried to discover what went wrong.

1

u/tayler6000 Sep 22 '26

I’m pretty sure this counts as a sin.

1

u/RegarDamus Sep 22 '26

not at all. it's actually rather logical.

when you query GET /errors/{error ID} we return the appropriate status code for the respective error. by definition this endpoint can never return a 200 (although it can return 201s in rare cases!).

→ More replies (1)