[gnome-software] trivial: Handle errors with the domain GFileError for AppStream
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Handle errors with the domain GFileError for AppStream
- Date: Fri, 4 Nov 2016 14:26:26 +0000 (UTC)
commit 5273945008a4f9e3aa00717bc554d85ef37a8557
Author: Richard Hughes <richard hughsie com>
Date: Fri Nov 4 14:26:16 2016 +0000
trivial: Handle errors with the domain GFileError for AppStream
src/gs-utils.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-utils.c b/src/gs-utils.c
index 9ccee9c..ac9bbd2 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -773,6 +773,20 @@ gs_utils_error_convert_appstream (GError **perror)
error->code = GS_PLUGIN_ERROR_FAILED;
break;
}
+ } else if (error->domain == G_FILE_ERROR) {
+ switch (error->code) {
+ case G_FILE_ERROR_EXIST:
+ case G_FILE_ERROR_ACCES:
+ case G_FILE_ERROR_PERM:
+ error->code = GS_PLUGIN_ERROR_NO_SECURITY;
+ break;
+ case G_FILE_ERROR_NOSPC:
+ error->code = GS_PLUGIN_ERROR_NO_SPACE;
+ break;
+ default:
+ error->code = GS_PLUGIN_ERROR_FAILED;
+ break;
+ }
} else {
g_warning ("can't reliably fixup error from domain %s",
g_quark_to_string (error->domain));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]