Don't log UnknownProperty error

When checking notification inhibition support
This commit is contained in:
Ilya Fedin 2021-01-24 00:32:37 +04:00 committed by John Preston
parent ae74f7b3da
commit c21125f9f2

View file

@ -149,10 +149,16 @@ void GetInhibitionSupported(Fn<void(bool)> callback) {
const auto async = QDBusConnection::sessionBus().asyncCall(message);
auto watcher = new QDBusPendingCallWatcher(async);
static const auto DontLogErrors = {
QDBusError::NoError,
QDBusError::InvalidArgs,
QDBusError::UnknownProperty,
};
const auto finished = [=](QDBusPendingCallWatcher *call) {
const auto error = QDBusPendingReply<QVariant>(*call).error();
if (error.isValid() && error.type() != QDBusError::InvalidArgs) {
if (!ranges::contains(DontLogErrors, error.type())) {
LOG(("Native Notification Error: %1: %2")
.arg(error.name())
.arg(error.message()));