From 1ff0cf8c16e142bc589ea5e2fddcce2afdf5af5a Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Sun, 19 Aug 2018 19:53:18 -0700 Subject: [PATCH] common: Register all FlatpakError codes as D-Bus errors This will allow us to return anything in the FlatpakError domain using g_dbus_method_invocation_return_gerror(). Closes: #1965 Approved by: alexlarsson --- common/flatpak-error.h | 1 + common/flatpak-utils.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/common/flatpak-error.h b/common/flatpak-error.h index ab05bc9c..ebaf756c 100644 --- a/common/flatpak-error.h +++ b/common/flatpak-error.h @@ -30,6 +30,7 @@ G_BEGIN_DECLS +/* NOTE: If you add an error code below, also update the list in common/flatpak-utils.c */ /** * FlatpakError: * @FLATPAK_ERROR_ALREADY_INSTALLED: App/runtime is already installed diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index c0c7b497..0634f9b0 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -52,6 +52,13 @@ static const GDBusErrorEntry flatpak_error_entries[] = { {FLATPAK_ERROR_ALREADY_INSTALLED, "org.freedesktop.Flatpak.Error.AlreadyInstalled"}, {FLATPAK_ERROR_NOT_INSTALLED, "org.freedesktop.Flatpak.Error.NotInstalled"}, + {FLATPAK_ERROR_ONLY_PULLED, "org.freedesktop.Flatpak.Error.OnlyPulled"}, /* Since: 1.0 */ + {FLATPAK_ERROR_DIFFERENT_REMOTE, "org.freedesktop.Flatpak.Error.DifferentRemote"}, /* Since: 1.0 */ + {FLATPAK_ERROR_ABORTED, "org.freedesktop.Flatpak.Error.Aborted"}, /* Since: 1.0 */ + {FLATPAK_ERROR_SKIPPED, "org.freedesktop.Flatpak.Error.Skipped"}, /* Since: 1.0 */ + {FLATPAK_ERROR_NEED_NEW_FLATPAK, "org.freedesktop.Flatpak.Error.NeedNewFlatpak"}, /* Since: 1.0 */ + {FLATPAK_ERROR_REMOTE_NOT_FOUND, "org.freedesktop.Flatpak.Error.RemoteNotFound"}, /* Since: 1.0 */ + {FLATPAK_ERROR_RUNTIME_NOT_FOUND, "org.freedesktop.Flatpak.Error.RuntimeNotFound"}, /* Since: 1.0 */ }; typedef struct archive FlatpakAutoArchiveRead;