From 996d89911d71f54f9a476242f1bd43c077d4428c Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Wed, 13 Jul 2011 15:27:07 -0400 Subject: Added an additional warning to json_gobject_new() The same warning that is fired when failing to deserialize properties normally needed to be added for the case that we fail to deserialize construct-only properties. --- json-glib/json-gobject.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'json-glib/json-gobject.c') diff --git a/json-glib/json-gobject.c b/json-glib/json-gobject.c index 0b91a5e..68d0d95 100644 --- a/json-glib/json-gobject.c +++ b/json-glib/json-gobject.c @@ -232,7 +232,12 @@ json_gobject_new (GType gtype, val = json_object_get_member (object, member_name); res = json_deserialize_pspec (¶m.value, pspec, val); if (!res) - g_value_unset (¶m.value); + { + g_warning ("Failed to deserialize \"%s\" property of type \"%s\" for an object of type \"%s\"", + pspec->name, G_VALUE_TYPE_NAME (¶m.value), g_type_name (gtype)); + + g_value_unset (¶m.value); + } else { param.name = g_strdup (pspec->name); -- cgit v1.2.1