[gnome-software/1425-bad-error-message-when-installing-broken-flatpakref-file] flatpak: Change error mapping for some codes to improve error reporting
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1425-bad-error-message-when-installing-broken-flatpakref-file] flatpak: Change error mapping for some codes to improve error reporting
- Date: Wed, 8 Sep 2021 19:41:47 +0000 (UTC)
commit a01aca0579642e9a46f00e33b6bf2ad93a7c0fe6
Author: Milan Crha <mcrha redhat com>
Date: Wed Sep 8 21:39:34 2021 +0200
flatpak: Change error mapping for some codes to improve error reporting
The "not supported" error code completely hides the actual error, which
is not good for the "not found" errors. Similarly, invalid data has its
own error code on the plugin side.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1425
plugins/flatpak/gs-flatpak-utils.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak-utils.c b/plugins/flatpak/gs-flatpak-utils.c
index 05ee126cd..8b107b37c 100644
--- a/plugins/flatpak/gs-flatpak-utils.c
+++ b/plugins/flatpak/gs-flatpak-utils.c
@@ -41,13 +41,15 @@ gs_flatpak_error_convert (GError **perror)
switch (error->code) {
case FLATPAK_ERROR_ALREADY_INSTALLED:
case FLATPAK_ERROR_NOT_INSTALLED:
- case FLATPAK_ERROR_REMOTE_NOT_FOUND:
- case FLATPAK_ERROR_RUNTIME_NOT_FOUND:
error->code = GS_PLUGIN_ERROR_NOT_SUPPORTED;
break;
case FLATPAK_ERROR_OUT_OF_SPACE:
error->code = GS_PLUGIN_ERROR_NO_SPACE;
break;
+ case FLATPAK_ERROR_INVALID_REF:
+ case FLATPAK_ERROR_INVALID_DATA:
+ error->code = GS_PLUGIN_ERROR_INVALID_FORMAT;
+ break;
default:
error->code = GS_PLUGIN_ERROR_FAILED;
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]