Add FLATPAK_ERROR_RUNTIME_NOT_FOUND error

This commit is contained in:
Alexander Larsson
2018-07-10 16:32:42 +02:00
committed by Alexander Larsson
parent 0ac154e913
commit 50fd8aee24
2 changed files with 8 additions and 4 deletions

View File

@@ -41,6 +41,7 @@ G_BEGIN_DECLS
* @FLATPAK_ERROR_SKIPPED: The App/Runtime install was skipped due to earlier errors.
* @FLATPAK_ERROR_NEED_NEW_FLATPAK: The App/Runtime needs a more recent version of flatpak.
* @FLATPAK_ERROR_REMOTE_NOT_FOUND: The specified remote was not found.
* @FLATPAK_ERROR_RUNTIME_NOT_FOUND: An runtime needed for the app was not found.
*
* Error codes for library functions.
*/
@@ -53,6 +54,7 @@ typedef enum {
FLATPAK_ERROR_SKIPPED,
FLATPAK_ERROR_NEED_NEW_FLATPAK,
FLATPAK_ERROR_REMOTE_NOT_FOUND,
FLATPAK_ERROR_RUNTIME_NOT_FOUND,
} FlatpakError;
#define FLATPAK_ERROR flatpak_error_quark ()

View File

@@ -1186,8 +1186,9 @@ find_runtime_remote (FlatpakTransaction *self,
if (remotes == NULL || *remotes == NULL)
{
flatpak_fail (error, _("The Application %s requires the %s which was not found"),
app_pref, runtime_pref);
flatpak_fail_error (error, FLATPAK_ERROR_RUNTIME_NOT_FOUND,
_("The Application %s requires the %s which was not found"),
app_pref, runtime_pref);
return NULL;
}
@@ -1201,8 +1202,9 @@ find_runtime_remote (FlatpakTransaction *self,
if (res >= 0 && res < g_strv_length (remotes))
return g_strdup (remotes[res]);
flatpak_fail (error, _("The Application %s requires the %s which is not installed"),
app_pref, runtime_pref);
flatpak_fail_error (error, FLATPAK_ERROR_RUNTIME_NOT_FOUND,
_("The Application %s requires the %s which is not installed"),
app_pref, runtime_pref);
return NULL;
}