Forum: Ruby How to handle errors thrown by Shell.rb

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
91308e9bc88cb069fd1bcf88e910d042?d=identicon&s=25 Nick Snels (nicksnels)
on 2006-01-25 23:04

I have this very simple code

require 'shell'
shell =
shell.transact do"#{path}")

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,

This topic is locked and can not be replied to.