make sure the error is caused by missing IconThemePath

This commit is contained in:
Pi-Yueh Chuang 2021-03-16 17:30:25 -04:00
parent c7180460dd
commit b76ca2b0bc
No known key found for this signature in database
GPG key ID: 4D88B842DD03DDE4

View file

@ -115,12 +115,16 @@ static int get_property_callback(sd_bus_message *msg, void *data,
const char *prop = d->prop; const char *prop = d->prop;
const char *type = d->type; const char *type = d->type;
void *dest = d->dest; void *dest = d->dest;
sway_log_importance_t log_lv = strcmp(prop, "IconThemePath") ? SWAY_ERROR : SWAY_DEBUG;
int ret; int ret;
if (sd_bus_message_is_method_error(msg, NULL)) { if (sd_bus_message_is_method_error(msg, NULL)) {
sway_log(log_lv, "%s %s: %s", sni->watcher_id, prop, const sd_bus_error *err = sd_bus_message_get_error(msg);
sd_bus_message_get_error(msg)->message); sway_log_importance_t log_lv = SWAY_ERROR;
if ((!strcmp(prop, "IconThemePath")) &&
(!strcmp(err->name, SD_BUS_ERROR_UNKNOWN_PROPERTY))) {
log_lv = SWAY_DEBUG;
}
sway_log(log_lv, "%s %s: %s", sni->watcher_id, prop, err->message);
ret = sd_bus_message_get_errno(msg); ret = sd_bus_message_get_errno(msg);
goto cleanup; goto cleanup;
} }