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
This commit is contained in:
Matthew Leeds
2018-08-19 19:53:18 -07:00
committed by Atomic Bot
parent 9fe1c60807
commit 1ff0cf8c16
2 changed files with 8 additions and 0 deletions

View File

@@ -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

View File

@@ -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;