📅  最后修改于: 2022-03-11 15:04:48.005000             🧑  作者: Mango
begin # "try" block
puts 'I am before the raise.'
raise 'An error has occurred.' # optionally: `raise Exception, "message"`
puts 'I am after the raise.' # won't be executed
rescue # optionally: `rescue Exception => ex`
puts 'I am rescued.'
ensure # will always get executed
puts 'Always gets executed.'
end