ipaddr icon indicating copy to clipboard operation
ipaddr copied to clipboard

Wrong InvalidAddressError message

Open tapalilov opened this issue 2 years ago • 2 comments

After changes from https://github.com/ruby/ipaddr/pull/16 and removing of

  rescue InvalidAddressError => e
    raise e.class, "#{e.message}: #{addr}"

exception no longer returns proper exception message with invalid ip address.

ruby 3.0

> IPAddr.new('192.168.0.1000')
ipaddr.rb:598:in `rescue in initialize': invalid address: 192.168.0.1000 (IPAddr::InvalidAddressError)

ruby 3.1

> IPAddr.new('192.168.0.1000')
ipaddr.rb:656:in `block in in_addr': invalid address:  (IPAddr::InvalidAddressError)

Best regards, Georgi.

tapalilov avatar Oct 25 '23 07:10 tapalilov

Yeah this regression impacts 1.2.3 and later, the last version with the correct error message is 1.2.2

tatethurston avatar Jul 19 '24 04:07 tatethurston