The best way to catch errors

access error. However, I don’t want to trap any other kinds of error
(e.g. I’d still like to be able to interrupt the program with ^C).

^C aka SIGINT does not raise an exception.
you have to trap it (ri trap)

Actually, it does raise exception Interrupt, so you can just do:

begin

your code

rescue Interrupt
puts “Oops, interrupted”
end

Gennady.