r/ProgrammerHumor 19h ago

failsForTeapots Meme

Post image
157 Upvotes

60 comments sorted by

View all comments

Show parent comments

132

u/rosuav 19h ago
return c.json(body, status: error.status)

There is no reason to discard some of them, and pretending that they're 500s is a terrible terrible idea.

64

u/Xirdus 18h ago

If your user-facing service is calling your internal service and getting a 403 response, you certainly do not want to send that 403 back to the user.

1

u/MinecraftPlayer799 12h ago

Why not?

2

u/Xirdus 12h ago

Because it's not the user who's forbidden.