(In reply to Aravinda from comment #2)
> auto conn = HTTP(url);
> download(url, "tmp", conn);
> auto status = conn.statusLine();
> if (status.code == 200){
Thanks, that's a helpful workaround for the time being.
But by default, high-level functions should throw on errors, so that they aren't accidentally ignored.
Comment #5 by dlang-bot — 2019-05-09T16:02:29Z
@MartinNowak updated dlang/phobos pull request #6102 "fix Issue 18318 - std.net.curl.download silently ignores non-2xx..." fixing this issue:
- fix Issue 18318 - std.net.curl.download silently ignores non-2xx...
...http statuses
- check status code of server response and throw HTTPStatusException
- still downloads the page if intended
- not using CURLOPT_FAILONERROR in the low-level API, as that has
would be too disruptive, and comes with many catches itself
i.e. only the high-level get/post/.../download/upload throw HTTPStatusExceptions
https://github.com/dlang/phobos/pull/6102
Comment #6 by dlang-bot — 2019-11-18T22:08:31Z
@MoonlightSentinel created dlang/dmd pull request #10590 "build.d: Make download fail reliably" mentioning this issue:
- build.d: Make download fail reliably
`download` would sometimes return true on failure (caused by Issue 18318 which
requires additional work in dub). This commit implements a temporary workaround
and should be reverted when the issue is resolved.
See https://issues.dlang.org/show_bug.cgi?id=18318https://github.com/dlang/dmd/pull/10590
Comment #7 by dlang-bot — 2019-11-19T00:29:52Z
dlang/dmd pull request #10590 "build.d: Make download fail reliably" was merged into master:
- 78e079b28027972b6cac862e81efd2f968b6f07c by MoonlightSentinel:
build.d: Make download fail reliably
`download` would sometimes return true on failure (caused by Issue 18318 which
requires additional work in dub). This commit implements a temporary workaround
and should be reverted when the issue is resolved.
See https://issues.dlang.org/show_bug.cgi?id=18318https://github.com/dlang/dmd/pull/10590
Comment #8 by robert.schadek — 2024-12-01T16:32:18Z