[glib/gsettings: 216/327] gvariant: two minor error reporting improvements
- From: Ryan Lortie <ryanl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glib/gsettings: 216/327] gvariant: two minor error reporting improvements
- Date: Thu, 27 Aug 2009 17:48:42 +0000 (UTC)
commit 62c51470d6ab544edbde5b4e8de0d946f1410828
Author: Tim-Philipp Müller <tim centricular net>
Date: Wed Jun 17 10:20:55 2009 +0100
gvariant: two minor error reporting improvements
Print some more information when we fail.
glib/gvariant-util.c | 3 ++-
glib/gvariant-valist.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/glib/gvariant-util.c b/glib/gvariant-util.c
index 7e374ac..3b4e224 100644
--- a/glib/gvariant-util.c
+++ b/glib/gvariant-util.c
@@ -1402,7 +1402,8 @@ g_variant_builder_check_add (GVariantBuilder *builder,
type_str = g_variant_type_dup_string (type);
g_set_error (error, G_VARIANT_BUILDER_ERROR,
G_VARIANT_BUILDER_ERROR_TYPE,
- "type '%s' is not in the correct class", type_str);
+ "type '%s' is not in the correct class, expected '%c'",
+ type_str, class);
g_free (type_str);
return FALSE;
}
diff --git a/glib/gvariant-valist.c b/glib/gvariant-valist.c
index daec123..c212cdf 100644
--- a/glib/gvariant-valist.c
+++ b/glib/gvariant-valist.c
@@ -1410,7 +1410,8 @@ g_variant_builder_add (GVariantBuilder *builder,
va_start (ap, format_string);
variant = g_variant_new_va (NULL, &format_string, &ap);
- g_assert (*format_string == '\0');
+ if (*format_string != '\0')
+ g_error ("Unhandled format string args: %s", format_string);
va_end (ap);
g_variant_builder_add_value (builder, variant);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]