From 818d715da838dfe158edee1ab40cdbf97c91ac69 Mon Sep 17 00:00:00 2001 From: "wtc@google.com" Date: Thu, 11 Sep 2008 00:24:09 +0000 Subject: Remove all but one place in this file where we return ERR_FAILED. In the remaining place, log the original Win32 error code to help diagnose a failure in the field. R=darin Review URL: http://codereview.chromium.org/2401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2044 0039d316-1c4b-4281-b951-d872f2087c98 --- net/http/http_transaction_winhttp.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'net') diff --git a/net/http/http_transaction_winhttp.cc b/net/http/http_transaction_winhttp.cc index 7c703d0..1808cb8 100644 --- a/net/http/http_transaction_winhttp.cc +++ b/net/http/http_transaction_winhttp.cc @@ -81,6 +81,8 @@ static int TranslateOSError(DWORD error) { default: DCHECK(error != ERROR_IO_PENDING); // WinHTTP doesn't use this error. + LOG(WARNING) << "Unknown error " << error + << " mapped to net::ERR_FAILED"; return ERR_FAILED; } } @@ -1240,7 +1242,7 @@ int HttpTransactionWinHttp::SendRequest() { // TODO(darin): no way to support >4GB uploads w/ WinHttp? if (upload_len > static_cast(DWORD(-1))) { NOTREACHED() << "upload length is too large"; - return ERR_FAILED; + return ERR_FILE_TOO_BIG; } total_size = static_cast(upload_len); @@ -1756,7 +1758,7 @@ void HttpTransactionWinHttp::HandleStatusCallback(DWORD status, DWORD_PTR result, DWORD error, DWORD secure_failure) { - int rv = ERR_FAILED; + int rv; switch (status) { case WINHTTP_CALLBACK_STATUS_REQUEST_ERROR: @@ -1777,6 +1779,8 @@ void HttpTransactionWinHttp::HandleStatusCallback(DWORD status, break; default: NOTREACHED() << "unexpected status code"; + rv = ERR_UNEXPECTED; + break; } if (rv == ERR_IO_PENDING) { -- cgit v1.1