diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2018-08-28 14:45:26 +0000 |
---|---|---|
committer | Sara Golemon <sara.golemon@mongodb.com> | 2018-08-29 03:11:11 +0000 |
commit | ba01c62b56ad109a17c11ed3ab609e0453eadf59 (patch) | |
tree | b973e71be544409086ba7fdd73d7f7bd7c727983 /src | |
parent | 145f3a4368ac2efe92d58ddb2462229e5c27365c (diff) | |
download | mongo-ba01c62b56ad109a17c11ed3ab609e0453eadf59.tar.gz |
SERVER-36613 Remove PyYaml depedency in configExpandRest tests
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/util/net/http_client_winhttp.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mongo/util/net/http_client_winhttp.cpp b/src/mongo/util/net/http_client_winhttp.cpp index 227c86bffef..cdae871784e 100644 --- a/src/mongo/util/net/http_client_winhttp.cpp +++ b/src/mongo/util/net/http_client_winhttp.cpp @@ -241,8 +241,18 @@ private: "Failed sending HTTP request", WinHttpSendRequest(request, _headers.c_str(), -1L, data, data_len, data_len, 0)); - uassertWithErrno("Failed receiving response from server", - WinHttpReceiveResponse(request, nullptr)); + if (!WinHttpReceiveResponse(request, nullptr)) { + // Carve out timeout which doesn't translate well. + const auto err = GetLastError(); + if (err == ERROR_WINHTTP_TIMEOUT) { + uasserted(ErrorCodes::OperationFailed, "Timeout was reached"); + } + const auto msg = errnoWithDescription(err); + uasserted(ErrorCodes::OperationFailed, + str::stream() << "Failed receiving response from server" + << ": " + << msg); + } DWORD statusCode = 0; DWORD statusCodeLength = sizeof(statusCode); |