Ruby Language Reference
begin code rescue StandardError expression end
rescue statement evaluates the expression if an exception (a subclass of StandardError) is raised during the execution of the code.
Rescue One Line Form
code rescue expression
name = '' rescue nil
The name variable would be blank when we encounter nil.