Use g_dataset_id_set_data() to store remote errors in GError
Submitted by Stef Walter
Assigned to David Zeuthen
Link to original bug (#684969)
Description
Currently GDBus prepends remote DBus error strings in the @message parameter of GError. This changed the semantics of the @message parameter from a human-readable string to a sorta structured string. It requires constant use of g_dbus_error_strip_remote_error() in code, which everybody forgets to do.
We can just use g_dataset_id_set_data_full() with a unique quark and a pointer to the GError struct to store a the remote error string. g_error_free() would need to call g_dataset_destroy() with a pointer to itself.
g_dbus_error_get_remote_error() would use g_dataset_id_get_data(), as would g_dbus_error_is_remote_error().
g_dbus_error_strip_remote_error() would become a deprecated no op.
Will try to cook up a patch for this.