apple / swift-async-dns-resolver

A Swift library for asynchronous DNS requests, wrapping c-ares with Swift-friendly APIs and data structures.
Apache License 2.0
82 stars 12 forks source link

Split error message from code #24

Closed glbrntt closed 4 months ago

glbrntt commented 4 months ago

Motivation:

Users can't check the code of an AsyncDNSResolver.Error because it's backed by an internal enum carrying a message as its associated data.

Modifications:

Result:

Users can programatically take action based on the code of an error

yim-lee commented 4 months ago

@swift-server-bot test this please