summaryrefslogtreecommitdiff
path: root/girepository/gdump.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-07-31 06:22:52 -0400
committerColin Walters <walters@verbum.org>2010-08-17 13:12:52 -0400
commit616a918019f730184bc7aee0f4570a67db8850b9 (patch)
tree4fa156698bc51a49504fd457bad3615e6d321b31 /girepository/gdump.c
parentc79b5be318cc2a9e15976c395e3ad910ef623d40 (diff)
downloadgobject-introspection-616a918019f730184bc7aee0f4570a67db8850b9.tar.gz
[girepository] Fix up error printing
We didn't show the right error message if we failed to find the symbol; fix this by removing error printing from the middle of the dumper, and add it correctly to the toplevel dump entry point.
Diffstat (limited to 'girepository/gdump.c')
-rw-r--r--girepository/gdump.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/girepository/gdump.c b/girepository/gdump.c
index 328f0752..3dc21728 100644
--- a/girepository/gdump.c
+++ b/girepository/gdump.c
@@ -68,6 +68,7 @@ static GType
invoke_get_type (GModule *self, const char *symbol, GError **error)
{
GetTypeFunc sym;
+ GType ret;
if (!g_module_symbol (self, symbol, (void**)&sym))
{
@@ -78,7 +79,15 @@ invoke_get_type (GModule *self, const char *symbol, GError **error)
return G_TYPE_INVALID;
}
- return sym ();
+ ret = sym ();
+ if (ret == G_TYPE_INVALID)
+ {
+ g_set_error (error,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "Function '%s' returned G_TYPE_INVALID", symbol);
+ }
+ return ret;
}
static void
@@ -429,7 +438,6 @@ g_irepository_dump (const char *arg, GError **error)
if (type == G_TYPE_INVALID)
{
- g_printerr ("Invalid GType: '%s'\n", line);
caught_error = TRUE;
g_free (line);
break;