css: Propagate errors properly

We should not change the domain and code when we propagate errors
that happen while parsing variable references.

Pointed out in https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7308.
This commit is contained in:
Matthias Clasen
2024-05-29 15:44:39 -04:00
parent fe5b28f5b8
commit 778976f8da

View File

@@ -224,11 +224,11 @@ parser_error (GtkCssParser *parser,
if (names[i + 1])
g_set_error (&new_error,
GTK_CSS_PARSER_ERROR, GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
error->domain, error->code,
"While expanding %s: %s", names[i + 1], error->message);
else
g_set_error_literal (&new_error,
GTK_CSS_PARSER_ERROR, GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
error->domain, error->code,
error->message);
if (vars[i]->section == NULL)