How to handle errors thrown by Shell.rb


#1

Hi,

I have this very simple code

require ‘shell’
shell = Shell.new
shell.transact do
shell.cat("#{path}")
end

Now suppose that the variable path is no longer available on disk or you
don’t have permissions to access the file. How can I capture this error
and provide a helpful message? I have already tried it with rescue
Errno::EACCES but that didn’t work. Thanks.

Kind regards,

Nick