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

Unified Diff: dbus/object_proxy.cc

Issue 455533002: Reduce DBus ObjectUnknown ERROR to WARNING (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Correctly log at severity Created 6 years, 4 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 | « dbus/object_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/object_proxy.cc
diff --git a/dbus/object_proxy.cc b/dbus/object_proxy.cc
index 5167cab76035ee50ec7a9f49082e9a6656f76513..d0b660b600dbc368fc28e4804d905cc5b90e6198 100644
--- a/dbus/object_proxy.cc
+++ b/dbus/object_proxy.cc
@@ -24,6 +24,7 @@ namespace dbus {
namespace {
const char kErrorServiceUnknown[] = "org.freedesktop.DBus.Error.ServiceUnknown";
+const char kErrorObjectUnknown[] = "org.freedesktop.DBus.Error.UnknownObject";
// Used for success ratio histograms. 1 for success, 0 for failure.
const int kSuccessRatioHistogramMaxValue = 2;
@@ -561,12 +562,20 @@ void ObjectProxy::LogMethodCallFailure(
const base::StringPiece& method_name,
const base::StringPiece& error_name,
const base::StringPiece& error_message) const {
- if (ignore_service_unknown_errors_ && error_name == kErrorServiceUnknown)
+ if (ignore_service_unknown_errors_ &&
+ (error_name == kErrorServiceUnknown || error_name == kErrorObjectUnknown))
return;
- LOG(ERROR) << "Failed to call method: "
- << interface_name << "." << method_name
- << ": object_path= " << object_path_.value()
- << ": " << error_name << ": " << error_message;
+ logging::LogSeverity severity = logging::LOG_ERROR;
+ // "UnknownObject" indicates that an object or service is no longer available,
+ // e.g. a Shill network service has gone out of range. Treat these as warnings
+ // not errors.
+ if (error_name == kErrorObjectUnknown)
+ severity = logging::LOG_WARNING;
+ std::ostringstream msg;
+ msg << "Failed to call method: " << interface_name << "." << method_name
+ << ": object_path= " << object_path_.value()
+ << ": " << error_name << ": " << error_message;
+ logging::LogAtLevel(severity, msg.str());
}
void ObjectProxy::OnCallMethodError(const std::string& interface_name,
« no previous file with comments | « dbus/object_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698