Commit d674463d authored by David Black's avatar David Black Committed by Commit Bot

Improve ChromiumHttpConnection logging.

Previously, in the event of network error, only HTTP status code was
being factored into logging. We want to print as much information as
is available to assist in debugging in the event of network error.

See bug for before/after.

Bug: b:132901765
Change-Id: I51d23c00e3533156f02d9ecc3b9e5f726ef74537
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614446Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarChris Mumford <cmumford@google.com>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#664310}
parent bbd76a96
...@@ -287,22 +287,15 @@ void ChromiumHttpConnection::OnComplete(bool success) { ...@@ -287,22 +287,15 @@ void ChromiumHttpConnection::OnComplete(bool success) {
delegate_->OnPartialResponse(partial_response); delegate_->OnPartialResponse(partial_response);
} }
if (success) { if (response_code != kResponseCodeInvalid) {
DCHECK_NE(response_code, kResponseCodeInvalid); delegate_->OnCompleteResponse(response_code, raw_headers, /*response=*/"");
delegate_->OnCompleteResponse(response_code, raw_headers, "");
return;
}
if (url_loader_->NetError() != net::OK) {
delegate_->OnNetworkError(kResponseCodeInvalid,
net::ErrorToString(url_loader_->NetError()));
return; return;
} }
const std::string message = net::ErrorToString(url_loader_->NetError()); const std::string message = net::ErrorToString(url_loader_->NetError());
VLOG(2) << "ChromiumHttpConnection completed with network error=" VLOG(2) << "ChromiumHttpConnection completed with network error="
<< response_code << ": " << message; << url_loader_->NetError() << ": " << message;
delegate_->OnNetworkError(response_code, message); delegate_->OnNetworkError(url_loader_->NetError(), message);
} }
void ChromiumHttpConnection::OnRetry(base::OnceClosure start_retry) { void ChromiumHttpConnection::OnRetry(base::OnceClosure start_retry) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment