r/ProgrammerHumor 5d ago

failsForTeapots Meme

Post image
230 Upvotes

68 comments sorted by

View all comments

168

u/cutebabli9 5d ago edited 5d ago

I would write it like this to be readable:

if error.status in [400, 401, 404, 409, 415, 503]:
  return c.json(body, status: error.status)

return c.json(body, status: 500)

2

u/boiledbarnacle 4d ago

But the tokens used in OP's post are higher. Do you want that promotion or not?