rescue_fromと

rescue_fromがException#causeを見るようになったらしい。(参考)

rescue_from SystemCallError, with: ...
rescue_from FooError, with: ...

def index
  open('foo/bar') { ... }
rescue Errno::ENOENT
  raise FooError
end

こういうのがRails 4と5で…… という気がしたんだがどうだろう?

raise FooError, cause: nilで回避。だがcauseがexperimental? (参考)

追記

beta3以降で解決済みであった。 (参考)