You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently had a problem where Host.fromString failed due to an underscore character (which seems reasonable). Could you provide an alternate version, eg. Host.fromStringEither which explains why host parsing failed?
The text was updated successfully, but these errors were encountered:
We could follow the precedent from scodec-bits and add def fromStringDescriptive(s: String): Either[String, Host]. We'd need to do that for a bunch of types though, not just Host. We'd also need to ensure the error messages are useful and not just stuff like ""foo_bar" is not a valid ip address, hostname, or IDN"
I had a go at implementing this and found it difficult. Since a host is one of three things, at least two of them will fail, so if all three fail (eg. something that's a hostname but an invalid one) then it's hard to know which one it was supposed to be.
Something more specific would fix this, but then there'd be a proliferation of methods HostName.fromStringDescriptive Ipv4Address.fromStringDescriptive etc.
I recently had a problem where
Host.fromString
failed due to an underscore character (which seems reasonable). Could you provide an alternate version, eg.Host.fromStringEither
which explains why host parsing failed?The text was updated successfully, but these errors were encountered: