def throw_if_true(param) begin raise "test exception" if param rescue Exception => e puts "rescue" ensure puts "ensure" endendthrow_if_true(true)# printed: "rescue" and "ensure"throw_if_true(false)# printed only "ensure"