From e6c6b057613859d884ae1a68858736af1ffb46a6 Mon Sep 17 00:00:00 2001 From: StefanBruens Date: Wed, 22 Aug 2018 03:07:54 +0200 Subject: [PATCH] Set error variable if there were some errors during refinement When as_pool_refine_data encounters bad components, this is reflected in the return code, but there is no further information given what went wrong. Give a short hint to the user, and refer to the debug output which allows determining the cause. --- src/as-pool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/as-pool.c b/src/as-pool.c index 67704b75..c381e418 100644 --- a/src/as-pool.c +++ b/src/as-pool.c @@ -1014,6 +1014,12 @@ as_pool_load (AsPool *pool, GCancellable *cancellable, GError **error) /* automatically refine the metadata we have in the pool */ ret = as_pool_refine_data (pool) && ret; + + /* report errors if there were errors from as_pool_refine_data */ + if (!ret && error && !*error) + *error = g_new_error_literal(AS_POOL_ERROR, + AS_POOL_ERROR_INCOMPLETE, + "Some components are invalid. See debug output for details"); return ret; }