This PR adds InternetAddress::tryFromString(), which is similar to fromString(), accept it returns null instead of throwing.
Seems we were a bit inconsistent with throwing SocketException vs. ValueError for invalid portions of the address. I changed them all to SocketException. I think this should be fine, since we declared the constructor and fromString as throwing SocketException on an invalid address.
This PR adds
InternetAddress::tryFromString()
, which is similar tofromString()
, accept it returnsnull
instead of throwing.Seems we were a bit inconsistent with throwing
SocketException
vs.ValueError
for invalid portions of the address. I changed them all toSocketException
. I think this should be fine, since we declared the constructor andfromString
as throwingSocketException
on an invalid address.