Check out example codes for "rails begin rescue". It will help you in understanding the concepts better.

Code Example 1

begin
  3 + '4'
rescue => e
  puts e.class
  puts e.message
  puts e.trace
end

Learn ReactJs, React Native from akashmittal.com