Can somebody tell why this happens ?


x = StandardError.new(:hello)
y = StandardError.new(:hello)
puts x == y # => true
puts x === y # => true

begin
  raise x
rescue x
  puts "ok" # gets printed
end

begin
  raise x
rescue y
  puts "ok" # doesn't get printed
end