For example,
begin
# Your normal code block here…rescue SomeException
# handle your exception here…else
# code run if it did not throw an exceptionensure
# This is the last thing to be run before it exits.
# Code in the ensure clause will always get executed.end