curl icon indicating copy to clipboard operation
curl copied to clipboard

`curl_url_parse()` doesn't give very helpful errors

Open hadley opened this issue 11 months ago • 2 comments

e.g.

curl::curl_parse_url("abc")
#> Error in curl::curl_parse_url("abc"): Failed to parse URL: Bad scheme

Created on 2025-01-08 with reprex v2.1.0

Would be useful to see the scheme or even maybe the full url here?

hadley avatar Jan 08 '25 16:01 hadley

We can't give you the scheme, because we failed to parse it. So curl can't make any sense of it. We could echo the full input url string in the error message if that is helpful.

jeroen avatar Jan 08 '25 20:01 jeroen

Yeah, that's what I've added temporary code in httr2 to do. But it feels like that would be most helpful in curl.

hadley avatar Jan 08 '25 20:01 hadley