Posted about 9 years ago. Visible to the public.

Ruby: Don't a add return in ensure

This method won't throw an error:

def a_method raise ensure return :something end

it will in fact return :something

So please proceed with care :)

Owner of this card:

Dragos Miron
Last edit:
almost 7 years ago
by dncrht
ensure, return
Posted by Dragos Miron to HouseTrip Deck
This website uses short-lived cookies to improve usability.
Accept or learn more