[gnome-builder] egg-state-machine: Raise more errors when parsing fails
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] egg-state-machine: Raise more errors when parsing fails
- Date: Thu, 21 May 2015 06:58:55 +0000 (UTC)
commit 4be5295bb6ab5e5a7c819d19928f24d6091b4a06
Author: Garrett Regier <garrettregier gmail com>
Date: Wed May 20 21:29:27 2015 -0700
egg-state-machine: Raise more errors when parsing fails
contrib/egg/egg-state-machine-buildable.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/contrib/egg/egg-state-machine-buildable.c b/contrib/egg/egg-state-machine-buildable.c
index 5b60966..5ac235e 100644
--- a/contrib/egg/egg-state-machine-buildable.c
+++ b/contrib/egg/egg-state-machine-buildable.c
@@ -130,8 +130,13 @@ add_state (StatesParserData *parser_data,
if (object == NULL)
{
- g_critical ("Failed to locate object %s for binding.", stack_obj->u.object.id);
- continue;
+ g_set_error (error,
+ GTK_BUILDER_ERROR,
+ GTK_BUILDER_ERROR_INVALID_VALUE,
+ "Unknown object for state '%s': %s",
+ item->u.state.name,
+ stack_obj->u.object.id);
+ return;
}
if (GTK_IS_WIDGET (object))
@@ -182,6 +187,18 @@ add_state (StatesParserData *parser_data,
GObject *relative;
relative = gtk_builder_get_object (parser_data->builder, stack_prop->u.property.text);
+
+ if (relative == NULL)
+ {
+ g_set_error (error,
+ GTK_BUILDER_ERROR,
+ GTK_BUILDER_ERROR_INVALID_VALUE,
+ "Unknown object for property '%s': %s",
+ stack_prop->u.property.name,
+ stack_prop->u.property.text);
+ return;
+ }
+
g_value_init (&value, pspec->value_type);
g_value_set_object (&value, relative);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]