libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.49k stars 924 forks source link

INVALID_URL_FORMAT has no error message #882

Closed offa closed 1 year ago

offa commented 1 year ago

Description

INVALID_URL_FORMAT errors don't contain an error message but an empty string.

Example/How to Reproduce

const auto response = cpr::Get(cpr::Url{"an invalid url"});

if (const auto error = response.error; error)
{
    std::cout << "<" << static_cast<int>(response.error.code) << ">: <" << error.message << ">\n";
}

Output:

<5>: <>

(5 is ErrorCode::INVALID_URL_FORMAT)

Possible Fix

No response

Where did you get it from?

conan

Additional Context/Your Environment

COM8 commented 1 year ago

Thanks for reporting but there is nothing we can do about it since this what we get from curl.