-
Notifications
You must be signed in to change notification settings - Fork 24
Simplify AsyncDNSResolver.Error #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@yim-lee An alternative could be having a minimal set of error codes on |
Yeah, the DNSSD implementation was done much later and it was an oversight of mine that I didn't even think about mapping the
This might be a good idea. I do think that some of the error codes are too specific, that I am not even sure what some of them mean. The common list you have in this PR is a good starting point, although
I wonder if knowing whether the error comes from c-ares or DNSSD (i.e., which implementation the library is using) is useful information? If so, then having So it might boil down to the following:
@glbrntt wdyt? |
Oh 100%, I was going on what sounded about right. The docs on the DNSSD error codes is... lacking.
Most of the time they won't be but I think it's worth having when the error code makes no sense i.e. we didn't know what to map it to so we put it as e.g. code 'unknown', if that happens then the user should be able to retrieve the underlying code to debug any further should they need (or report back as an issue).
Yeah this sounds good although I think the |
Yeah, makes sense. 👍 |
Motivation: The 'AsyncDNSResolver.Error' is closely modelled on the c-ares error codes and doesn't fit well with the DNSSD error codes. Further, the DNSSD backed doesn't map its error cdes back into an 'AsyncDNSResolver.Error' so all DNSSD errors become 'other' errors. Modifications: - Reduce the number of error codes in 'AsyncDNSResolver.Error' to a few high level error codes and a catch-all 'internal' error code. - Update mappings from c-ares error codes, add mappings from dnssd error codes. - Add a 'source' property, which can be 'any Error', allowing users to get fine grained error information if necessary. Result: Error codes are more consistent across implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Motivation:
The 'AsyncDNSResolver.Error' is closely modelled on the c-ares error
codes and doesn't fit well with the DNSSD error codes. Further, the
DNSSD backed doesn't map its error cdes back into an
'AsyncDNSResolver.Error' so all DNSSD errors become 'other' errors.
Modifications:
high level error codes and a catch-all 'internal' error code.
codes.
get fine grained error information if necessary.
Result:
Error codes are more consistent across implementations.