[gnome-software] snap: Don't treat auth cancellation as an error



commit 14ebc6dbe3900a914206a21e3ffb9e8cf6a93281
Author: Andrea Azzarone <andrea azzarone canonical com>
Date:   Fri Aug 3 15:43:01 2018 +0300

    snap: Don't treat auth cancellation as an error
    
    SNAPD_ERROR_PERMISSION_DENIED is triggered when the user cancels the PolicyKit
    authorization process. For this reasons treat this error in a special way to
    avoid showing an error notification.
    
    Fixes: https://bugs.launchpad.net/bugs/1785240

 meson.build                   | 2 +-
 plugins/snap/gs-plugin-snap.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index dcf42af6..603ffa6b 100644
--- a/meson.build
+++ b/meson.build
@@ -167,7 +167,7 @@ if get_option('gudev')
 endif
 
 if get_option('snap')
-  snap = dependency('snapd-glib', version : '>= 1.42')
+  snap = dependency('snapd-glib', version : '>= 1.43')
 endif
 
 gnome = import('gnome')
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index d34948fe..8d09b687 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -124,6 +124,9 @@ snapd_error_convert (GError **perror)
                case SNAPD_ERROR_TWO_FACTOR_INVALID:
                        error->code = GS_PLUGIN_ERROR_AUTH_INVALID;
                        break;
+               case SNAPD_ERROR_AUTH_CANCELLED:
+                       error->code = GS_PLUGIN_ERROR_CANCELLED;
+                       break; 
                case SNAPD_ERROR_CONNECTION_FAILED:
                case SNAPD_ERROR_WRITE_FAILED:
                case SNAPD_ERROR_READ_FAILED:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]