Skip to content

Throwing a DnsException rather than calling fail #4

Closed
@chrisdone

Description

@chrisdone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions