throw_error() immediately returns for Device methods which are called
internally from the daemon (i. e. without an actual PolicyKit check), as we do
not have a D-BUS invocation context. Print out the error message in this case
as well.
va_list args;
char *message;
- if (context == NULL)
- return TRUE;
-
va_start (args, format);
message = g_strdup_vprintf (format, args);
va_end (args);
+ if (context == NULL)
+ {
+ g_warning ("%s", message);
+ return TRUE;
+ }
+
error = g_error_new (ERROR, error_code, "%s", message);
dbus_g_method_return_error (context, error);
g_error_free (error);