Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1925)

Unified Diff: google_apis/drive/drive_api_requests.cc

Issue 2163903002: Report detailed batch upload error by UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/drive_api_requests.cc
diff --git a/google_apis/drive/drive_api_requests.cc b/google_apis/drive/drive_api_requests.cc
index 307e5411477dd7e4c935af33f141b95119bf98c8..9d6c29fd29ab9ca2ce24edd7da7d4122d207abca 100644
--- a/google_apis/drive/drive_api_requests.cc
+++ b/google_apis/drive/drive_api_requests.cc
@@ -1394,11 +1394,18 @@ std::vector<std::string> BatchUploadRequest::GetExtraRequestHeaders() const {
void BatchUploadRequest::ProcessURLFetchResults(const net::URLFetcher* source) {
// Return the detailed raw HTTP code if the error code is abstracted
- // DRIVE_OTHER_ERROR.
- UMA_HISTOGRAM_SPARSE_SLOWLY(kUMADriveBatchUploadResponseCode,
- GetErrorCode() != DRIVE_OTHER_ERROR
- ? GetErrorCode()
- : source->GetResponseCode());
+ // DRIVE_OTHER_ERROR. If HTTP connection is failed and the status code is -1,
+ // return network status error.
+ int histogram_error = 0;
+ if (GetErrorCode() != DRIVE_OTHER_ERROR) {
+ histogram_error = GetErrorCode();
+ } else if (source->GetResponseCode() != -1) {
+ histogram_error = source->GetResponseCode();
+ } else {
+ histogram_error = source->GetStatus().error();
+ }
+ UMA_HISTOGRAM_SPARSE_SLOWLY(
+ kUMADriveBatchUploadResponseCode, histogram_error);
if (!IsSuccessfulDriveApiErrorCode(GetErrorCode())) {
RunCallbackOnPrematureFailure(GetErrorCode());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698