diff options
author | Matthew Leeds <matthew.leeds@endlessm.com> | 2019-07-25 09:15:50 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2019-08-15 19:42:45 +0000 |
commit | b44c1a57993905da0a99e5b1f8f1bffd5bb25eee (patch) | |
tree | 7d47070e84d106215f7a1b009290d5e0dc208f1c | |
parent | 9a258e8a0c36637a43b442592f7d3b5a6eb2ab7c (diff) | |
download | flatpak-b44c1a57993905da0a99e5b1f8f1bffd5bb25eee.tar.gz |
dir: Don't overzealously rewrite an error
It's an error to call g_set_error() on an error that's already set, and
flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED
for us when necessary, so just pass on any errors to the caller of
flatpak_dir_get_origin(). In the case that the error is something else,
that should be treated as an error, because we never expect the deploy
directory to exist but not have a deploy file (see the implementations
of flatpak_dir_deploy() and flatpak_dir_undeploy()).
Closes: #3032
Approved by: alexlarsson
-rw-r--r-- | common/flatpak-dir.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 8f9dc66c..cc3e9bf4 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -2627,11 +2627,7 @@ flatpak_dir_get_origin (FlatpakDir *self, deploy_data = flatpak_dir_get_deploy_data (self, ref, FLATPAK_DEPLOY_VERSION_ANY, cancellable, error); if (deploy_data == NULL) - { - g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED, - _("%s not installed"), ref); - return NULL; - } + return NULL; return g_strdup (flatpak_deploy_data_get_origin (deploy_data)); } |