Description
Would you accept a PR that replaced the calls to fail
such as these with e.g. throwIO ResQueryFailed
?
I'd like to use this API for my SMTP server and I'd like to check SPF records (via TXT and SPF), it'd be nice to do a catch
of type DnsException
to handle all DNS-resolving issues.
Presently if I use a domain that doesn't have a TXT record, the failure isn't the best:
> queryTXT (Network.DNS.Name "chrisdone.com")
*** Exception: user error (res_query(3) failed)
In the case of a failed query, I'd mark incoming email as spam. So that's a fine case, other cases, I might want to log as an issue. At present I'd have to match on the strings.
Should be a quick update. And any existing code using this lib would (hopefully) get a non-exhaustive pattern match warning when upgrading. But it could also be a major version bump with a CHANGELOG warning.