Rescue all errors of a specific type inside a module
问题 I have a module in which I am performing all of my encryption/decryption tasks for a project. I would like to catch any OpenSSL::Cipher::CipherError exceptions that occur in this module so that I can handle them. Is it possible to do something like rescue_from OpenSSL::Cipher::CipherError, :with => :cipher_error inside of a module? 回答1: I've investigated a little and came with a solution. You said you have a module in which you do your encryption. I'm guessing that module represents a