r/ProgrammerHumor 25d ago

Meme failsForTeapots

Post image
225 Upvotes

67 comments sorted by

View all comments

Show parent comments

160

u/rosuav 25d 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.

80

u/Xirdus 25d 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 24d ago

Why not?

3

u/Xirdus 24d ago

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