diff options
author | Colin Walters <walters@verbum.org> | 2010-07-22 13:46:33 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-07-22 13:48:32 -0400 |
commit | ae193fd2e793cbd8c209f375e1119321ee2de6b6 (patch) | |
tree | d2f669decdccf4840232e27f43fc2847d667f614 | |
parent | 7bcb292e7ff35764a02629213589f304df8b5076 (diff) | |
download | gobject-introspection-ae193fd2e793cbd8c209f375e1119321ee2de6b6.tar.gz |
[girepository] Include path to file in typelib load failure error
This makes version conflicts more obvious.
-rw-r--r-- | girepository/girepository.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/girepository/girepository.c b/girepository/girepository.c index df09d822..f379cf68 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -1224,9 +1224,19 @@ g_irepository_require (GIRepository *repository, goto out; } - typelib = g_typelib_new_from_mapped_file (mfile, error); - if (!typelib) - goto out; + { + GError *temp_error = NULL; + typelib = g_typelib_new_from_mapped_file (mfile, &temp_error); + if (!typelib) + { + g_set_error (error, G_IREPOSITORY_ERROR, + G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, + "Failed to load typelib file '%s' for namespace '%s': %s", + path, namespace, temp_error->message); + g_clear_error (&temp_error); + goto out; + } + } header = (Header *) typelib->data; typelib_namespace = g_typelib_get_string (typelib, header->namespace); typelib_version = g_typelib_get_string (typelib, header->nsversion); |