summaryrefslogtreecommitdiff
path: root/atspi/atspi-misc-private.h
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2011-01-04 12:04:12 -0600
committerMike Gorse <mgorse@novell.com>2011-01-04 12:04:12 -0600
commite1909af6050686754cd4fa43aa61859c084f6e11 (patch)
treefab874075a39b234ceab7fbe8529eca674682968 /atspi/atspi-misc-private.h
parent50a78f9729c622b2fc38b49902ae7324e1bdb136 (diff)
downloadat-spi2-core-e1909af6050686754cd4fa43aa61859c084f6e11.tar.gz
Return exceptions for errors rather than printing warnings
Diffstat (limited to 'atspi/atspi-misc-private.h')
-rw-r--r--atspi/atspi-misc-private.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/atspi/atspi-misc-private.h b/atspi/atspi-misc-private.h
index 4814719f..52ba2fdf 100644
--- a/atspi/atspi-misc-private.h
+++ b/atspi/atspi-misc-private.h
@@ -147,11 +147,20 @@ void _atspi_dbus_set_interfaces (AtspiAccessible *accessible, DBusMessageIter *i
void _atspi_dbus_set_state (AtspiAccessible *accessible, DBusMessageIter *iter);
-#define _ATSPI_DBUS_CHECK_SIG(message, type, ret) \
+#define _ATSPI_DBUS_CHECK_SIG(message, type, error, ret) \
if (!message) { \
g_warning ("at-spi: Got no message at %s line %d\n", __FILE__, __LINE__); \
return (ret); \
} \
+ if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) \
+ { \
+ const char *err; \
+ dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &err, DBUS_TYPE_INVALID); \
+ if (err) \
+ g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_IPC, err); \
+ dbus_message_unref (message); \
+ return ret; \
+ } \
if (strcmp (dbus_message_get_signature (message), type) != 0) \
{ \
g_warning ("at-spi: Expected message signature %s but got %s at %s line %d", type, dbus_message_get_signature (message), __FILE__, __LINE__); \
@@ -176,6 +185,7 @@ GQuark atspi_error_quark (void);
*/
typedef enum
{
- ATSPI_ERROR_APPLICATION_GONE
+ ATSPI_ERROR_APPLICATION_GONE,
+ ATSPI_ERROR_IPC
} AtspiError;
#endif /* _ATSPI_MISC_PRIVATE_H_ */