Skip to content
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

Display name of error code instead of number #15473

Closed
jeroen opened this issue Nov 1, 2024 · 3 comments
Closed

Display name of error code instead of number #15473

jeroen opened this issue Nov 1, 2024 · 3 comments
Labels

Comments

@jeroen
Copy link
Contributor

jeroen commented Nov 1, 2024

When the curl command line has an error, the numeric value of the error enum is printed, for example below (35):

curl "https://packages.r-universe.dev"
curl: (35) OpenSSL/3.3.2: error:0A000458:SSL routines::tlsv1 unrecognized name

This is too very informative. We can easily convert this into readable code using curl_easy_option_by_id(x)->name such that we get the string CURLE_SSL_CONNECT_ERROR, which is a bit more informative.

Would it be a suggestion to print the error name (minus the curle_ prefix) such that it would look like:

curl: (ssl_connect_error) OpenSSL/3.3.2: error:0A000458:SSL routines::tlsv1 unrecognized name

curl/libcurl version

curl 8.10.1

@bagder bagder added the TLS label Nov 1, 2024
bagder added a commit that referenced this issue Nov 1, 2024
Previously there were three error situations that only added the (unhelpful)
OpenSSL error strings, now we prefix those with a short explanation for the
error situation.

Reported-by: Jeroen Ooms
Fixes #15473
@bagder
Copy link
Member

bagder commented Nov 1, 2024

I don't think we should remove the number. I think we should make sure to have the error string/explanation as good as possible.

@jeroen
Copy link
Contributor Author

jeroen commented Nov 2, 2024

I think the named error code would be easier for users to google than a number. The error buffer is of course also important but sometimes that information does not explain why curl errored.

Either way, just a suggestion :)

@bagder
Copy link
Member

bagder commented Nov 3, 2024

I don't want to remove the number since it has been there for years and is now an established way curl shows errors. Also, the error name is not enough to fully explain most errors either - that's what we have a full error message for.

@bagder bagder closed this as completed in 6b2bc81 Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants