title: Rescue all Errno errors in ruby
body: <p>I want to grab all the Errno errors like Errno::ENOENT, Errno::EIO, Errno::ENODEV, etc in my program, but I don't want to grab something else - like ArgumentError or RuntimeError.</p>
  <p>My current implementation is this:</p>
  <pre><code>begin
      raise Errno::EIO
  rescue StandardError
      raise $! unless $!.class.name.partition(-'::').first == -'Errno'
  end
  </code></pre>
  <p>But is there a better way to do this?</p>