begin
# something which might raise an exception
rescue SomeExceptionClass => some_variable
# code that deals with some exception
rescue SomeOtherException => some_other_variable
# code that deals with some other exception
else
# code that runs only if *no* exception was raised
ensure
# ensure that this code always runs, no matter what
# does not change the final value of the block
end
begin
fire_ze_missiles
rescue
retry #just once more for good luck
else
log "We set up them the bomb."
ensure
wtf_mate
end