diff options
author | Milan Crha <mcrha@redhat.com> | 2021-07-27 19:07:32 +0200 |
---|---|---|
committer | Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com> | 2021-07-28 06:41:30 -0400 |
commit | 32b052298e6bcfd3c149a6f4cd8498e084aa5b28 (patch) | |
tree | f77bc3747ec1e78e3d59a780d7e525a53a557870 /lib | |
parent | e67a447783e871883dbb676b1ecdb6a005b5464e (diff) |
pk-task: Add specific error code when user declined interaction
To make it easier to know, in the code, that the user declined
the interaction on the task and react on it properly, rather than
checking a generic error code and the error message, which can
eventually change in the future.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/packagekit-glib2/pk-client.h | 2 | ||||
-rw-r--r-- | lib/packagekit-glib2/pk-task.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/packagekit-glib2/pk-client.h b/lib/packagekit-glib2/pk-client.h index bef916f58..f203b18fa 100644 --- a/lib/packagekit-glib2/pk-client.h +++ b/lib/packagekit-glib2/pk-client.h @@ -57,6 +57,7 @@ G_BEGIN_DECLS * @PK_CLIENT_ERROR_INVALID_FILE: the file is invalid * @PK_CLIENT_ERROR_NOT_SUPPORTED: the action is not supported * @PK_CLIENT_ERROR_DECLINED_SIMULATION: the simulation was declined by the user + * @PK_CLIENT_ERROR_DECLINED_INTERACTION: the user declined interaction on the task * @PK_CLIENT_ERROR_LAST: * * Errors that can be thrown @@ -73,6 +74,7 @@ typedef enum PK_CLIENT_ERROR_INVALID_FILE, PK_CLIENT_ERROR_NOT_SUPPORTED, PK_CLIENT_ERROR_DECLINED_SIMULATION, + PK_CLIENT_ERROR_DECLINED_INTERACTION, /* we define this so we can punt the PkErrorEnums here at offset 0xff */ PK_CLIENT_ERROR_LAST } PkClientError; diff --git a/lib/packagekit-glib2/pk-task.c b/lib/packagekit-glib2/pk-task.c index d4823148f..6470f2389 100644 --- a/lib/packagekit-glib2/pk-task.c +++ b/lib/packagekit-glib2/pk-task.c @@ -821,7 +821,7 @@ pk_task_user_declined_idle_cb (PkTaskState *state) g_debug ("declined request %i", state->request); g_set_error (&error, PK_CLIENT_ERROR, - PK_CLIENT_ERROR_FAILED, "user declined interaction"); + PK_CLIENT_ERROR_DECLINED_INTERACTION, "user declined interaction"); pk_task_generic_state_finish (state, error); return FALSE; } |