[gnome-software] trivial: Add ERROR_WRITE_FAILED



commit e725087ae41af9cff0f522a78089a38f566b4d7c
Author: Richard Hughes <richard hughsie com>
Date:   Wed Sep 7 14:59:03 2016 +0100

    trivial: Add ERROR_WRITE_FAILED

 src/gs-plugin.c                  |    4 +++-
 src/gs-plugin.h                  |    2 ++
 src/gs-utils.c                   |    2 +-
 src/plugins/gs-plugin-epiphany.c |    2 +-
 src/plugins/gs-plugin-fwupd.c    |    4 ++--
 5 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-plugin.c b/src/gs-plugin.c
index 0bb5ca8..74a4d0a 100644
--- a/src/gs-plugin.c
+++ b/src/gs-plugin.c
@@ -1163,7 +1163,7 @@ gs_plugin_download_file (GsPlugin *plugin,
                                  &error_local)) {
                g_set_error (error,
                             GS_PLUGIN_ERROR,
-                            GS_PLUGIN_ERROR_FAILED,
+                            GS_PLUGIN_ERROR_WRITE_FAILED,
                             "Failed to save file: %s",
                             error_local->message);
                return FALSE;
@@ -1305,6 +1305,8 @@ gs_plugin_error_to_string (GsPluginError error)
                return "plugin-depsolve-failed";
        if (error == GS_PLUGIN_ERROR_DOWNLOAD_FAILED)
                return "download-failed";
+       if (error == GS_PLUGIN_ERROR_WRITE_FAILED)
+               return "write-failed";
        return NULL;
 }
 
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index 44e54ae..a618d97 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -112,6 +112,7 @@ typedef guint64 GsPluginFlags;
  * @GS_PLUGIN_ERROR_ACCOUNT_DEACTIVATED:       User account has been deactivated
  * @GS_PLUGIN_ERROR_PLUGIN_DEPSOLVE_FAILED:    The plugins installed are incompatible
  * @GS_PLUGIN_ERROR_DOWNLOAD_FAILED:           The download action failed
+ * @GS_PLUGIN_ERROR_WRITE_FAILED:              The save-to-disk failed
  *
  * The failure error types.
  **/
@@ -129,6 +130,7 @@ typedef enum {
        GS_PLUGIN_ERROR_ACCOUNT_DEACTIVATED,
        GS_PLUGIN_ERROR_PLUGIN_DEPSOLVE_FAILED,
        GS_PLUGIN_ERROR_DOWNLOAD_FAILED,
+       GS_PLUGIN_ERROR_WRITE_FAILED,
        /*< private >*/
        GS_PLUGIN_ERROR_LAST
 } GsPluginError;
diff --git a/src/gs-utils.c b/src/gs-utils.c
index dd02735..d75882c 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -330,7 +330,7 @@ gs_utils_symlink (const gchar *target, const gchar *linkpath, GError **error)
        if (symlink (target, linkpath) != 0) {
                g_set_error (error,
                             GS_PLUGIN_ERROR,
-                            GS_PLUGIN_ERROR_FAILED,
+                            GS_PLUGIN_ERROR_WRITE_FAILED,
                             "failed to create symlink from %s to %s",
                             linkpath, target);
                return FALSE;
diff --git a/src/plugins/gs-plugin-epiphany.c b/src/plugins/gs-plugin-epiphany.c
index a64bb18..d561a18 100644
--- a/src/plugins/gs-plugin-epiphany.c
+++ b/src/plugins/gs-plugin-epiphany.c
@@ -130,7 +130,7 @@ gs_plugin_app_install (GsPlugin *plugin, GsApp *app,
                } else {
                        g_set_error (error,
                                     GS_PLUGIN_ERROR,
-                                    GS_PLUGIN_ERROR_FAILED,
+                                    GS_PLUGIN_ERROR_WRITE_FAILED,
                                     "Can't symlink icon: %s",
                                     error_local->message);
                        return FALSE;
diff --git a/src/plugins/gs-plugin-fwupd.c b/src/plugins/gs-plugin-fwupd.c
index d4d08e8..9168e48 100644
--- a/src/plugins/gs-plugin-fwupd.c
+++ b/src/plugins/gs-plugin-fwupd.c
@@ -629,7 +629,7 @@ gs_plugin_fwupd_check_lvfs_metadata (GsPlugin *plugin,
                                  &error_local)) {
                g_set_error (error,
                             GS_PLUGIN_ERROR,
-                            GS_PLUGIN_ERROR_FAILED,
+                            GS_PLUGIN_ERROR_WRITE_FAILED,
                             "Failed to save firmware: %s",
                             error_local->message);
                return FALSE;
@@ -727,7 +727,7 @@ gs_plugin_refresh (GsPlugin *plugin,
                                          &error_local)) {
                        g_set_error (error,
                                     GS_PLUGIN_ERROR,
-                                    GS_PLUGIN_ERROR_FAILED,
+                                    GS_PLUGIN_ERROR_WRITE_FAILED,
                                     "Failed to save firmware: %s",
                                     error_local->message);
                        return FALSE;


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