[gnome-software] trivial: snap: use g_error_matches() instead of directly looking at the GError
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: snap: use g_error_matches() instead of directly looking at the GError
- Date: Thu, 29 Jun 2017 15:58:03 +0000 (UTC)
commit c9f6d58ba110c62a2a9dcbe877fb8498b3707e5e
Author: Iain Lane <iain orangesquash org uk>
Date: Thu Jun 29 16:56:46 2017 +0100
trivial: snap: use g_error_matches() instead of directly looking at the GError
plugins/snap/gs-plugin-snap.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index cb580c6..8c7b816 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -567,7 +567,7 @@ gs_plugin_app_install (GsPlugin *plugin,
{
g_autoptr(SnapdClient) client = NULL;
- g_autoptr (GError) local_error = NULL;
+ g_autoptr(GError) local_error = NULL;
/* We can only install apps we know of */
if (g_strcmp0 (gs_app_get_management_plugin (app), "snap") != 0)
@@ -578,7 +578,7 @@ gs_plugin_app_install (GsPlugin *plugin,
if (client == NULL)
return FALSE;
if (!snapd_client_install_sync (client, gs_app_get_id (app), NULL, progress_cb, app, cancellable,
&local_error)) {
- if (local_error && local_error->code == SNAPD_ERROR_AUTH_DATA_REQUIRED) {
+ if (g_error_matches (local_error, SNAPD_ERROR, SNAPD_ERROR_AUTH_DATA_REQUIRED)) {
g_set_error_literal (error,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_AUTH_REQUIRED,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]