42 lines
1.3 KiB
Diff
42 lines
1.3 KiB
Diff
|
From 53cf4a6635586e68c7a45030b381bc98d4f9eb1c Mon Sep 17 00:00:00 2001
|
||
|
From: David Zeuthen <davidz@redhat.com>
|
||
|
Date: Wed, 8 Apr 2009 12:04:17 -0400
|
||
|
Subject: [PATCH] for now, prepend the D-Bus error name to the error string from the daemon
|
||
|
|
||
|
This is hidden behind a GtkExpander so it's not exactly a big deal. As
|
||
|
noted we can removed this once we port to PolicyKit 1.0.
|
||
|
---
|
||
|
src/gdu/gdu-error.c | 9 +++++++++
|
||
|
1 files changed, 9 insertions(+), 0 deletions(-)
|
||
|
|
||
|
diff --git a/src/gdu/gdu-error.c b/src/gdu/gdu-error.c
|
||
|
index 956c61c..992c4d8 100644
|
||
|
--- a/src/gdu/gdu-error.c
|
||
|
+++ b/src/gdu/gdu-error.c
|
||
|
@@ -57,6 +57,7 @@ _gdu_error_fixup (GError *error)
|
||
|
{
|
||
|
const char *name;
|
||
|
gboolean matched;
|
||
|
+ gchar *s;
|
||
|
|
||
|
if (error == NULL)
|
||
|
return;
|
||
|
@@ -89,6 +90,14 @@ _gdu_error_fixup (GError *error)
|
||
|
|
||
|
if (matched)
|
||
|
error->domain = GDU_ERROR;
|
||
|
+
|
||
|
+ /* Always prepend the D-Bus exception name to the message; we need this in
|
||
|
+ * gdu_error_check_polkit_not_authorized() to determine if it's a PolicyKit
|
||
|
+ * exception... when we port to polkit 1.0 this can go away.
|
||
|
+ */
|
||
|
+ s = g_strdup_printf ("%s: %s", name, error->message);
|
||
|
+ g_free (error->message);
|
||
|
+ error->message = s;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
--
|
||
|
1.6.2.2
|
||
|
|