On Saturday, 11 June 2016 at 23:03:52 UTC, ikod wrote:
Hello,
Dlang-requests is library created under influence of
Python-requests, with primary goal of easy to use and
performance.
I have a couple of questions. If a url can't be found and I catch
the ConnectError exception and handle it[2] I still get an
additional error[1] printed. For example:
try
{
getContent(url);
}
catch(ConnectError ex)
{
debug writeln("Error getting page: ", ex.msg);
}
Will error with this:
[1]2016-06-21T20:59:15.073:streams.d:connect:750 Failed to
connect: can't resolve www.systemcontrolpanel.com - getaddrinfo
error: Name or service not known
[2]Error getting page: Can't connect to
www.systemcontrolpanel.com:80: getaddrinfo error: Name or service
not known
The additional error[1] will still print in release build. The
only workaround I could find was to check getAddress myself and
ensure that the page exists before calling getContent.
Thanks!