From 73970ee0b4ea6351958b01ab6d9973b9eb6b2065 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Wed, 25 Sep 2024 17:03:33 +0200 Subject: [PATCH] gopenuriportal: Improve error messages --- gio/gopenuriportal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gio/gopenuriportal.c b/gio/gopenuriportal.c index dbd97c23b..308d876e4 100644 --- a/gio/gopenuriportal.c +++ b/gio/gopenuriportal.c @@ -84,7 +84,7 @@ g_openuri_portal_open_file (GFile *file, if (fd == -1) { g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), - "Failed to open '%s'", path); + "Failed to open ā€˜%sā€™: %s", path, g_strerror (errsv)); g_free (path); g_variant_builder_clear (&opt_builder); return FALSE; @@ -125,6 +125,8 @@ g_openuri_portal_open_file (GFile *file, g_free (uri); } + g_prefix_error (error, "Failed to call OpenURI portal: "); + g_clear_object (&openuri); return res; @@ -355,7 +357,7 @@ g_openuri_portal_open_file_async (GFile *file, g_clear_object (&task); g_task_report_new_error (NULL, callback, user_data, NULL, G_IO_ERROR, g_io_error_from_errno (errsv), - "OpenURI portal is not available"); + "Failed to open ā€˜%sā€™: %s", path, g_strerror (errsv)); g_clear_object (&openuri); return; }