summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-12 16:48:10 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-12 17:17:27 +0200
commit712fc9fc081a5cbaf150624b0d5ce15b7ea18849 (patch)
treeb520731b13bb520e56ae7d3e65f53114a4c12476
parent2ef6d9d5d999a5e3a6b970c8a4a68b52daf987f4 (diff)
Use the installed/not-installed errors more consequently
-rw-r--r--app/flatpak-builtins-install.c3
-rw-r--r--common/flatpak-dir.c8
-rw-r--r--lib/flatpak-installation.c4
3 files changed, 8 insertions, 7 deletions
diff --git a/app/flatpak-builtins-install.c b/app/flatpak-builtins-install.c
index 1034dac..f1500e7 100644
--- a/app/flatpak-builtins-install.c
+++ b/app/flatpak-builtins-install.c
@@ -32,6 +32,7 @@
#include "flatpak-builtins.h"
#include "flatpak-utils.h"
+#include "lib/flatpak-error.h"
#include "flatpak-chain-input-stream.h"
static char *opt_arch;
@@ -237,7 +238,7 @@ flatpak_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro
return flatpak_fail (error, "%s %s, branch %s is already installed",
is_app ? "App" : "Runtime", name, branch ? branch : "master");
- if (!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
+ if (!g_error_matches (my_error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED))
{
g_propagate_error (error, g_steal_pointer (&my_error));
return FALSE;
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 7dbd93c..a50869c 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -720,7 +720,7 @@ flatpak_dir_get_deploy_data (FlatpakDir *self,
deploy_dir = flatpak_dir_get_if_deployed (self, ref, NULL, cancellable);
if (deploy_dir == NULL)
{
- flatpak_fail (error, "%s is not installed", ref);
+ g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED, "%s not installed", ref);
return NULL;
}
@@ -755,7 +755,7 @@ flatpak_dir_get_origin (FlatpakDir *self,
cancellable, error);
if (deploy_data == NULL)
{
- flatpak_fail (error, "%s is not installed", ref);
+ g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED, "%s not installed", ref);
return NULL;
}
@@ -776,7 +776,7 @@ flatpak_dir_get_subpaths (FlatpakDir *self,
cancellable, error);
if (deploy_data == NULL)
{
- flatpak_fail (error, "%s is not installed", ref);
+ g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED, "%s not installed", ref);
return NULL;
}
@@ -3698,7 +3698,7 @@ flatpak_dir_find_installed_ref (FlatpakDir *self,
}
}
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED,
"%s %s not installed", name, opt_branch ? opt_branch : "master");
return NULL;
}
diff --git a/lib/flatpak-installation.c b/lib/flatpak-installation.c
index 16f8a7f..c9e7201 100644
--- a/lib/flatpak-installation.c
+++ b/lib/flatpak-installation.c
@@ -390,7 +390,7 @@ flatpak_installation_get_installed_ref (FlatpakInstallation *self,
ref, NULL, cancellable);
if (deploy == NULL)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED,
"Ref %s no installed", ref);
return NULL;
}
@@ -429,7 +429,7 @@ flatpak_installation_get_current_installed_app (FlatpakInstallation *self,
if (deploy == NULL)
{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED,
"App %s no installed", name);
return NULL;
}