shill: Error: Attribute source from PopulateAndLog
Have callers pass the source file/line of PopulateAndLog calls so
the log message can disambiguate the ultimate source of the error.
BUG=chromium:449528
TEST=Unit tests + manual: restart shill and "grep error.cc /var/log/net.log"
Change-Id: I7bb54e966b047025a3ec7ef18acce5b8bed3d031
Reviewed-on: https://chromium-review.googlesource.com/241522
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/dns_client.cc b/dns_client.cc
index 0cc5aa9..51e0971 100644
--- a/dns_client.cc
+++ b/dns_client.cc
@@ -84,7 +84,7 @@
bool DNSClient::Start(const string &hostname, Error *error) {
if (running_) {
- Error::PopulateAndLog(error, Error::kInProgress,
+ Error::PopulateAndLog(FROM_HERE, error, Error::kInProgress,
"Only one DNS request is allowed at a time");
return false;
}
@@ -95,7 +95,7 @@
options.timeout = timeout_ms_;
if (dns_servers_.empty()) {
- Error::PopulateAndLog(error, Error::kInvalidArguments,
+ Error::PopulateAndLog(FROM_HERE, error, Error::kInvalidArguments,
"No valid DNS server addresses");
return false;
}
@@ -105,7 +105,7 @@
&options,
ARES_OPT_TIMEOUTMS);
if (status != ARES_SUCCESS) {
- Error::PopulateAndLog(error, Error::kOperationFailed,
+ Error::PopulateAndLog(FROM_HERE, error, Error::kOperationFailed,
"ARES initialization returns error code: " +
base::IntToString(status));
resolver_state_.reset();
@@ -135,7 +135,7 @@
status = ares_->SetServersCsv(resolver_state_->channel,
server_addresses.c_str());
if (status != ARES_SUCCESS) {
- Error::PopulateAndLog(error, Error::kOperationFailed,
+ Error::PopulateAndLog(FROM_HERE, error, Error::kOperationFailed,
"ARES set DNS servers error code: " +
base::IntToString(status));
resolver_state_.reset();