From 60e98dd2b761f22947a7df5b1f58eef2df35a13c Mon Sep 17 00:00:00 2001 From: knu Date: Thu, 9 Aug 2018 08:40:54 +0000 Subject: Include the input in the message when raising InvalidAddressError [Feature #5987] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/ipaddr.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb index 60f102d4e6..09645f500c 100644 --- a/lib/ipaddr.rb +++ b/lib/ipaddr.rb @@ -594,6 +594,8 @@ class IPAddr else @mask_addr = (@family == Socket::AF_INET) ? IN4MASK : IN6MASK end + rescue InvalidAddressError => e + raise e.class, "#{e.message}: #{addr}" end def coerce_other(other) -- cgit v1.2.3