Conversation
* Add more tracing information to c-ares errors. * remove CURL_ASYNC_SUCCESS, rename `ares->last_status` to `ares->ares_status`. Give trace explanation for "common" errors * add ares "csv" information to tracing on failure * DoH: invoke `Curl_resolver_error()` on failure to populate error buf
bagder
reviewed
Aug 11, 2025
bagder
approved these changes
Aug 11, 2025
Contributor
MichalPetryka
left a comment
There was a problem hiding this comment.
I think that more info should be added to normal error messages too, not just trace since stuff like whether address doesn't exist or if DNS server isn't responding matter to normal users too, not just devs and even web browsers show that info by default.
Comment on lines
+363
to
+380
| const char *msg; | ||
| switch(ares->ares_status) { | ||
| case ARES_ECONNREFUSED: | ||
| msg = "connection to DNS server refused"; | ||
| break; | ||
| case ARES_ETIMEOUT: | ||
| msg = "query to DNS server timed out"; | ||
| break; | ||
| case ARES_ENOTFOUND: | ||
| msg = "DNS server did not find the address"; | ||
| break; | ||
| case ARES_EREFUSED: | ||
| msg = "DNS server refused query"; | ||
| break; | ||
| default: | ||
| msg = "resolve failed"; | ||
| break; | ||
| } |
Contributor
There was a problem hiding this comment.
Wouldn't it be better to use ares_strerror here?
Contributor
Author
There was a problem hiding this comment.
Agree. Looked for such a function, but initially failed. My bad.
Contributor
Author
|
Just made #18251 where the error string is retrieved from c-ares and added to the "normal" failure message. So, curl users with c-ares can see the reason a resolve failed without doing anything special. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ares->last_statustoares->ares_status. Give trace explanation for "common" errorsCurl_resolver_error()on failure to populate error buf