[glib] glib-compile-schemas: Improve an error message
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] glib-compile-schemas: Improve an error message
- Date: Sat, 16 May 2015 02:54:37 +0000 (UTC)
commit 074fe89f226d4c0f3c6bdd48b6b03c8051fbaf75
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 15 22:53:41 2015 -0400
glib-compile-schemas: Improve an error message
Mention the expected type when failing to parse a GVariant.
gio/glib-compile-schemas.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
index 31161fb..2262a3f 100644
--- a/gio/glib-compile-schemas.c
+++ b/gio/glib-compile-schemas.c
@@ -469,6 +469,13 @@ key_state_end_default (KeyState *state,
state->default_value = g_variant_parse (state->type,
state->unparsed_default_value->str,
NULL, NULL, error);
+ if (!state->default_value)
+ {
+ gchar *type = g_variant_type_dup_string (state->type);
+ g_prefix_error (error, "failed to parse <default> value of type '%s': ", type);
+ g_free (type);
+ }
+
key_state_check_range (state, error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]