mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Silence ServiceUnknown and Disconnected errors for native notifications
This commit is contained in:
parent
3808874da0
commit
cb930a89ce
1 changed files with 12 additions and 5 deletions
|
@ -60,8 +60,17 @@ void StartServiceAsync(
|
|||
try {
|
||||
result(); // get the error if any
|
||||
} catch (const Glib::Error &e) {
|
||||
LOG(("Native Notification Error: %1").arg(
|
||||
QString::fromStdString(e.what())));
|
||||
static const auto NotSupportedErrors = {
|
||||
"org.freedesktop.DBus.Error.ServiceUnknown",
|
||||
};
|
||||
|
||||
const auto errorName =
|
||||
Gio::DBus::ErrorUtils::get_remote_error(e);
|
||||
|
||||
if (!ranges::contains(NotSupportedErrors, errorName)) {
|
||||
LOG(("Native Notification Error: %1").arg(
|
||||
QString::fromStdString(e.what())));
|
||||
}
|
||||
} catch (const std::exception &e) {
|
||||
LOG(("Native Notification Error: %1").arg(
|
||||
QString::fromStdString(e.what())));
|
||||
|
@ -72,9 +81,7 @@ void StartServiceAsync(
|
|||
cancellable);
|
||||
|
||||
return;
|
||||
} catch (const Glib::Error &e) {
|
||||
LOG(("Native Notification Error: %1").arg(
|
||||
QString::fromStdString(e.what())));
|
||||
} catch (...) {
|
||||
}
|
||||
|
||||
crl::on_main([=] { callback(); });
|
||||
|
|
Loading…
Add table
Reference in a new issue