summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 20:14:06 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 20:14:06 +0000
commitfd6c39e9b18d373bbf58ffe8975206308a3ef5e3 (patch)
tree94554ccac2528b4b60fc4c602e6e485520a818bf /chromeos
parent37403f36a6984400c226fda2afd139be51043a1c (diff)
downloadchromium_src-fd6c39e9b18d373bbf58ffe8975206308a3ef5e3.zip
chromium_src-fd6c39e9b18d373bbf58ffe8975206308a3ef5e3.tar.gz
chromium_src-fd6c39e9b18d373bbf58ffe8975206308a3ef5e3.tar.bz2
Don't set error_detail to 'Unexpected State' just log it
BUG=299900 R=armansito@chromium.org, pneubeck@chromium.org Review URL: https://codereview.chromium.org/24998008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/network/network_connection_handler.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/chromeos/network/network_connection_handler.cc b/chromeos/network/network_connection_handler.cc
index 263a000..f22e7b4 100644
--- a/chromeos/network/network_connection_handler.cc
+++ b/chromeos/network/network_connection_handler.cc
@@ -553,23 +553,24 @@ void NetworkConnectionHandler::CheckPendingRequest(
}
// Network is neither connecting or connected; an error occurred.
- std::string error_name, error_detail;
+ std::string error_name; // 'Canceled' or 'Failed'
+ // If network->error() is empty here, we will look it up later, but we
+ // need to preserve it in case Shill clears it before then. crbug.com/302020.
+ std::string shill_error = network->error();
if (network->connection_state() == shill::kStateIdle &&
pending_requests_.size() > 1) {
// Another connect request canceled this one.
error_name = kErrorConnectCanceled;
- error_detail = "";
} else {
error_name = shill::kErrorConnectFailed;
- error_detail = network->error();
- if (error_detail.empty()) {
- if (network->connection_state() == shill::kStateFailure)
- error_detail = shill::kUnknownString;
- else
- error_detail = "Unexpected State: " + network->connection_state();
+ if (network->connection_state() != shill::kStateFailure) {
+ NET_LOG_ERROR("Unexpected State: " + network->connection_state(),
+ service_path);
}
}
- std::string error_msg = error_name + ": " + error_detail;
+ std::string error_msg = error_name;
+ if (!shill_error.empty())
+ error_msg += ": " + shill_error;
NET_LOG_ERROR(error_msg, service_path);
network_handler::ErrorCallback error_callback = request->error_callback;
@@ -577,7 +578,7 @@ void NetworkConnectionHandler::CheckPendingRequest(
if (error_callback.is_null())
return;
scoped_ptr<base::DictionaryValue> error_data(
- network_handler::CreateErrorData(service_path, error_name, error_detail));
+ network_handler::CreateErrorData(service_path, error_name, shill_error));
error_callback.Run(error_name, error_data.Pass());
}