Check out example codes for "ruby try catch variable and assign nil value". It will help you in understanding the concepts better.

Code Example 1

test = a_function_that_will_fail rescue "I crashed!"
test
# => "I crashed"

Learn ReactJs, React Native from akashmittal.com