If you are opening a file which does not exist then if you did not handle this situation properly then yo.
Ruby error handling best practices.
Ruby exceptions the execution and the exception always go together.
December 19th 2016 by rivkah standig.
Ruby exception handling primer for dealing with errors in ruby.
Ruby hook methods article if you are unfamiliar with the hook methods in ruby.
Cleanup before crashing often we have no idea when our program is going to.
To get the most out of your own applications and to fully manage any and all ruby exceptions check out the airbrake ruby exception handling tool offering real time alerts and instantaneous insight into what went wrong with your ruby code including integrated support for a variety of popular ruby gems and frameworks.
Feel free to read the metaprogramming.