portal: improve error message

This commit is contained in:
Wim Taymans 2020-11-29 16:51:33 +01:00
parent 75a4cff450
commit 3d93b2492c

View file

@ -53,7 +53,6 @@ struct impl {
DBusPendingCall *portal_pid_pending; DBusPendingCall *portal_pid_pending;
pid_t portal_pid; pid_t portal_pid;
unsigned int first:1;
}; };
static void static void
@ -132,6 +131,13 @@ static void on_portal_pid_received(DBusPendingCall *pending,
pw_log_error("Failed to receive portal pid"); pw_log_error("Failed to receive portal pid");
return; 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);
pw_log_error("Failed to receive portal pid: %s: %s",
dbus_message_get_error_name(m), message);
return;
}
dbus_error_init(&error); dbus_error_init(&error);
dbus_message_get_args(m, &error, DBUS_TYPE_UINT32, &portal_pid, dbus_message_get_args(m, &error, DBUS_TYPE_UINT32, &portal_pid,
@ -145,7 +151,6 @@ static void on_portal_pid_received(DBusPendingCall *pending,
} else { } else {
pw_log_info("Got portal pid %d", portal_pid); pw_log_info("Got portal pid %d", portal_pid);
impl->portal_pid = portal_pid; impl->portal_pid = portal_pid;
impl->first = true;
} }
} }