What is the difference between throw/catch and raise/rescue?

Technology CommunityCategory: RubyWhat is the difference between throw/catch and raise/rescue?
VietMX Staff asked 3 years ago

throw and catch accept matching symbols as arguments and should be considered a control-flow structure where raise and rescue is used to raise and handle exceptions. throw and catch are not commonly used while exception handling with raise and rescue is used often.