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

Add URL to timeout error message #190

Closed
mattdowle opened this issue Jul 22, 2019 · 6 comments
Closed

Add URL to timeout error message #190

mattdowle opened this issue Jul 22, 2019 · 6 comments

Comments

@mattdowle
Copy link

mattdowle commented Jul 22, 2019

Hi,
curl usually works great and we all completely rely on it. Today I hit a rare problem that I tweeted about (here) in case someone else knows what the URL is that it is timing out on in this case. In general, it would be great if the error message including the URL that it was timing out on. For cases like this where all I see is a log file.
image
I'm trying to create a PR to curl to do this. I searched this repo for the string "timed" to find the error message but nothing came up. Then I searched this repo for "curl_fetch_memory" and I found lots of usage but, oddly, not where it is defined. I'll keep trying.
Could you give me some hints as to where I might modify the code to include the URL in the timeout error message?
Thanks, Matt

@mattdowle mattdowle changed the title Add URL to timeout error Add URL to timeout error message Jul 22, 2019
@mattdowle mattdowle changed the title Add URL to timeout error message Include URL in timeout error message Jul 22, 2019
@mattdowle mattdowle changed the title Include URL in timeout error message Add URL to timeout error message Jul 22, 2019
@krlmlr
Copy link

krlmlr commented Jul 22, 2019

Perhaps in assert_status() ? Looks like the error message comes from libcurl.

curl/src/utils.c

Lines 44 to 49 in 1d9ba65

void assert_status(CURLcode res, reference *ref){
if(res == CURLE_OPERATION_TIMEDOUT)
Rf_error("%s: %s", curl_easy_strerror(res), ref->errbuf);
if(res != CURLE_OK)
Rf_error("%s", strlen(ref->errbuf) ? ref->errbuf : curl_easy_strerror(res));
}

@mattdowle
Copy link
Author

Thanks for the tip, @krlmlr! I was able to trace it though from there and filed the PR.

@mattdowle
Copy link
Author

I just saw the same timeout again. Is there anything else you'd like me to do in PR #191?
image

@jeroen jeroen closed this as completed in a789a15 Sep 23, 2019
@jeroen
Copy link
Owner

jeroen commented Sep 24, 2019

Fix on CRAN now.

@mattdowle
Copy link
Author

mattdowle commented Sep 24, 2019

Great. Thanks, Jeroen!

@krlmlr
Copy link

krlmlr commented Apr 21, 2020

Can we also include the hostname in generic error messages? Seeing travis build failures from pkgdown.

https://travis-ci.org/github/krlmlr/dm/jobs/677591111#L1151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants