def throw_if_true(param)
begin
raise "test exception" if param
rescue Exception => e
puts "rescue"
else
puts "else"
end
end
throw_if_true(true)
# printed: "rescue"
throw_if_true(false)
# напечатано только "else"