Skip to content

Commit

Permalink
Silence some dbus errors
Browse files Browse the repository at this point in the history
Log info when a service is not running and disable it.
  • Loading branch information
wtay committed Jan 14, 2021
1 parent 7347b5e commit be10731
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spa/plugins/bluez5/backend-ofono.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ static void ofono_register_reply(DBusPendingCall *pending, void *user_data)
spa_log_warn(backend->log, NAME": Error registering profile");
goto finish;
}
if (dbus_message_is_error(r, DBUS_ERROR_SERVICE_UNKNOWN)) {
spa_log_info(backend->log, NAME": oFono not available, disabling");
goto finish;
}
if (dbus_message_get_type(r) == DBUS_MESSAGE_TYPE_ERROR) {
spa_log_error(backend->log, NAME": Register() failed: %s",
dbus_message_get_error_name(r));
Expand Down
4 changes: 4 additions & 0 deletions src/modules/module-portal.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ static void on_portal_pid_received(DBusPendingCall *pending,
pw_log_error("Failed to receive portal pid");
return;
}
if (dbus_message_is_error(m, DBUS_ERROR_NAME_HAS_NO_OWNER)) {
pw_log_info("Portal is not running");
return;
}
if (dbus_message_get_type(m) == DBUS_MESSAGE_TYPE_ERROR) {
const char *message = "unknown";
dbus_message_get_args(m, NULL, DBUS_TYPE_STRING, &message, DBUS_TYPE_INVALID);
Expand Down

0 comments on commit be10731

Please sign in to comment.