mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-03 23:04:49 -04:00
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 (cherry picked from commitb44c1a5799) (cherry picked from commit8ed03ef61e) Closes: #3115 Approved by: alexlarsson
This commit is contained in:
committed by
Atomic Bot
parent
e4a7b2e2fd
commit
11070054b4
@@ -2422,11 +2422,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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user