From 3089328914de8925f6b4a7d174c601ea95b4a515 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 7 May 2012 16:58:51 +0100 Subject: [PATCH 2/4] Use TP_ERROR instead of deprecated TP_ERRORS --- plugins/console.c | 12 ++++++------ plugins/gateways.c | 12 ++++++------ plugins/test.c | 4 ++-- src/addressing-util.c | 34 +++++++++++++++++----------------- src/call-channel.c | 6 +++--- src/call-member.c | 4 ++-- src/call-muc-channel.c | 4 ++-- src/call-stream.c | 2 +- src/conn-avatars.c | 14 +++++++------- src/conn-contact-info.c | 20 ++++++++++---------- src/conn-location.c | 10 +++++----- src/conn-mail-notif.c | 8 ++++---- src/conn-olpc.c | 38 +++++++++++++++++++------------------- src/conn-presence.c | 8 ++++---- src/conn-sidecars.c | 8 ++++---- src/connection.c | 30 +++++++++++++++--------------- src/error.c | 16 ++++++++-------- src/ft-channel.c | 30 +++++++++++++++--------------- src/ft-manager.c | 14 +++++++------- src/im-channel.c | 4 ++-- src/im-factory.c | 2 +- src/media-channel.c | 42 +++++++++++++++++++++--------------------- src/media-factory.c | 4 ++-- src/media-stream.c | 8 ++++---- src/message-util.c | 2 +- src/muc-channel.c | 32 ++++++++++++++++---------------- src/muc-factory.c | 20 ++++++++++---------- src/plugin-loader.c | 2 +- src/plugin.c | 6 +++--- src/private-tubes-factory.c | 10 +++++----- src/request-pipeline.c | 2 +- src/roomlist-manager.c | 4 ++-- src/roster.c | 4 ++-- src/search-channel.c | 26 +++++++++++++------------- src/search-manager.c | 10 +++++----- src/server-sasl-channel.c | 4 ++-- src/server-tls-manager.c | 2 +- src/tls-certificate.c | 6 +++--- src/tube-dbus.c | 10 +++++----- src/tube-stream.c | 36 ++++++++++++++++++------------------ src/tubes-channel.c | 30 +++++++++++++++--------------- src/util.c | 2 +- src/vcard-manager.c | 2 +- tests/tp-error-from-wocky.c | 2 +- 44 files changed, 273 insertions(+), 273 deletions(-) diff --git a/plugins/console.c b/plugins/console.c index 6e24e4f..69dd1e1 100644 --- a/plugins/console.c +++ b/plugins/console.c @@ -95,7 +95,7 @@ gabble_console_plugin_create_sidecar_async ( } else { - g_simple_async_result_set_error (result, TP_ERRORS, + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' not implemented", sidecar_interface); } @@ -492,7 +492,7 @@ get_iq_type (const gchar *type_str, return TRUE; } - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Type must be 'get' or 'set', not '%s'", type_str); return FALSE; } @@ -510,7 +510,7 @@ validate_jid (const gchar **to, if (wocky_decode_jid (*to, NULL, NULL, NULL)) return TRUE; - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid (or empty) JID", *to); return FALSE; } @@ -541,7 +541,7 @@ parse_me_a_stanza ( if (stanza == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Incomplete stanza! Bad person."); return FALSE; } @@ -620,13 +620,13 @@ stanza_looks_coherent ( if (t == WOCKY_STANZA_TYPE_UNKNOWN) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "I don't know what a <%s/> is", top_node->name); return FALSE; } else if (st == WOCKY_STANZA_SUB_TYPE_UNKNOWN) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "I don't know what type='%s' means", wocky_node_get_attribute (top_node, "type")); return FALSE; diff --git a/plugins/gateways.c b/plugins/gateways.c index b9b2323..8f12112 100644 --- a/plugins/gateways.c +++ b/plugins/gateways.c @@ -95,7 +95,7 @@ gabble_gateway_plugin_create_sidecar_async ( } else { - g_simple_async_result_set_error (result, TP_ERRORS, + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' not implemented", sidecar_interface); } @@ -422,12 +422,12 @@ register_cb (GObject *source, switch (error->code) { case WOCKY_XMPP_ERROR_CONFLICT: - g_set_error (&tp_error, TP_ERRORS, TP_ERROR_REGISTRATION_EXISTS, + g_set_error (&tp_error, TP_ERROR, TP_ERROR_REGISTRATION_EXISTS, "someone else registered that username: %s", error->message); break; case WOCKY_XMPP_ERROR_NOT_ACCEPTABLE: - g_set_error (&tp_error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&tp_error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "registration not acceptable: %s", error->message); break; @@ -487,21 +487,21 @@ gateways_register ( if (strchr (gateway, '@') != NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Gateway names cannot contain '@': %s", gateway); goto error; } if (strchr (gateway, '/') != NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Gateway names cannot contain '/': %s", gateway); goto error; } if (!wocky_decode_jid (gateway, NULL, &normalized_gateway, NULL)) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid gateway name: %s", gateway); goto error; } diff --git a/plugins/test.c b/plugins/test.c index ba1f5fd..92c0833 100644 --- a/plugins/test.c +++ b/plugins/test.c @@ -113,7 +113,7 @@ test_plugin_create_sidecar_async ( /* This deliberately doesn't check for IFACE_TEST_BUGGY, to test Gabble's * reactions to buggy plugins. :) */ - g_simple_async_result_set_error (result, TP_ERRORS, + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' not implemented", sidecar_interface); } @@ -442,7 +442,7 @@ iq_cb ( if (t == WOCKY_STANZA_SUB_TYPE_RESULT) g_simple_async_result_set_op_res_gboolean (result, TRUE); else - g_simple_async_result_set_error (result, TP_ERRORS, + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "server said no!"); g_object_unref (reply); diff --git a/src/addressing-util.c b/src/addressing-util.c index 0f1b3ff..049c566 100644 --- a/src/addressing-util.c +++ b/src/addressing-util.c @@ -85,7 +85,7 @@ gabble_uri_to_jid (const gchar *uri, if (scheme == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid URI", uri); goto OUT; } @@ -106,7 +106,7 @@ gabble_uri_to_jid (const gchar *uri, } else { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' URI scheme is not supported by this protocol", scheme); goto OUT; @@ -137,7 +137,7 @@ gabble_jid_to_uri (const gchar *scheme, if (!wocky_decode_jid (jid, &node, &domain, &resource)) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid JID", jid); return NULL; } @@ -234,7 +234,7 @@ gabble_vcard_address_to_jid (const gchar *vcard_field, if (gabble_error != NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is an invalid address: %s", vcard_address, gabble_error->message); g_error_free (gabble_error); @@ -249,7 +249,7 @@ gabble_vcard_address_to_jid (const gchar *vcard_field, s++; if (G_UNLIKELY (*s != '\0')) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is an invalid facebook chat address", vcard_address); goto OUT; } @@ -258,7 +258,7 @@ gabble_vcard_address_to_jid (const gchar *vcard_field, } else { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' vCard field is not supported by this protocol", vcard_field); } @@ -286,7 +286,7 @@ gabble_jid_to_vcard_address (const gchar *vcard_field, if (gabble_error != NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is an invalid address: %s", jid, gabble_error->message); g_error_free (gabble_error); @@ -312,13 +312,13 @@ gabble_jid_to_vcard_address (const gchar *vcard_field, s++; if (G_UNLIKELY (*s != '\0')) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is an invalid facebook chat address", jid); } } else { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is an invalid facebook chat address", jid); } @@ -326,7 +326,7 @@ gabble_jid_to_vcard_address (const gchar *vcard_field, } else { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' vCard field is not supported by this protocol", vcard_field); } @@ -438,7 +438,7 @@ gabble_parse_xmpp_uri (const gchar *uri, if (scheme == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid URI", uri); goto OUT; } @@ -447,7 +447,7 @@ gabble_parse_xmpp_uri (const gchar *uri, if (!wocky_decode_jid (jid, &tmp_node, &tmp_domain, &tmp_resource)) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid XMPP URI", uri); goto OUT; } @@ -458,7 +458,7 @@ gabble_parse_xmpp_uri (const gchar *uri, unescaped_node = g_uri_unescape_string (tmp_node, NULL); if (unescaped_node == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid XMPP URI", uri); goto OUT; } @@ -468,7 +468,7 @@ gabble_parse_xmpp_uri (const gchar *uri, unescaped_domain = g_uri_unescape_string (tmp_domain, NULL); if (unescaped_domain == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid XMPP URI", uri); goto OUT; } @@ -478,7 +478,7 @@ gabble_parse_xmpp_uri (const gchar *uri, unescaped_resource = g_uri_unescape_string (tmp_resource, NULL); if (unescaped_resource == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid XMPP URI", uri); goto OUT; } @@ -491,7 +491,7 @@ gabble_parse_xmpp_uri (const gchar *uri, if (gabble_error != NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid XMPP URI: %s", uri, gabble_error->message); g_error_free (gabble_error); @@ -500,7 +500,7 @@ gabble_parse_xmpp_uri (const gchar *uri, if (!wocky_decode_jid (normalized_jid, node, domain, resource)) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a valid XMPP URI", uri); goto OUT; } diff --git a/src/call-channel.c b/src/call-channel.c index affa839..f51454f 100644 --- a/src/call-channel.c +++ b/src/call-channel.c @@ -434,11 +434,11 @@ contact_is_media_capable (GabbleCallChannel *self, *wait_ret = wait; if (presence == NULL) - g_set_error (error, TP_ERRORS, TP_ERROR_OFFLINE, + g_set_error (error, TP_ERROR, TP_ERROR_OFFLINE, "contact %d (%s) has no presence available", handle, tp_handle_inspect (contact_handles, handle)); else - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_CAPABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "contact %d (%s) doesn't have sufficient media caps", handle, tp_handle_inspect (contact_handles, handle)); @@ -666,7 +666,7 @@ call_channel_add_content (TpBaseCallChannel *base, if (initial_direction == TP_MEDIA_STREAM_DIRECTION_NONE) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Jingle can not do contents with direction = NONE"); return NULL; } diff --git a/src/call-member.c b/src/call-member.c index c5522d1..9435e4f 100644 --- a/src/call-member.c +++ b/src/call-member.c @@ -465,7 +465,7 @@ gabble_call_member_create_content (GabbleCallMember *self, if (content_ns == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Content type %d not available for this resource", mtype); return NULL; } @@ -549,7 +549,7 @@ gabble_call_member_start_session (GabbleCallMember *self, target, audio_name != NULL, video_name != NULL, &transport, &dialect, &resource)) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_CAPABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "member does not have the desired audio/video capabilities"); return FALSE; } diff --git a/src/call-muc-channel.c b/src/call-muc-channel.c index fdd5e71..75d2b1b 100644 --- a/src/call-muc-channel.c +++ b/src/call-muc-channel.c @@ -1162,14 +1162,14 @@ call_muc_channel_add_content (TpBaseCallChannel *base, if (initial_direction == TP_MEDIA_STREAM_DIRECTION_NONE) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Jingle can not do contents with direction = NONE"); return NULL; } if (initial_direction != TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Adding un-directional contents is not supported" " in MUC channels"); return NULL; diff --git a/src/call-stream.c b/src/call-stream.c index a25365d..4e2aff9 100644 --- a/src/call-stream.c +++ b/src/call-stream.c @@ -584,7 +584,7 @@ gabble_call_stream_add_candidates (TpBaseMediaCallStream *stream, if (accepted_candidates->len == 0 && candidates->len != 0) { - g_set_error_literal (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error_literal (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "All candidates had the wrong Type"); tp_clear_pointer (&accepted_candidates, g_ptr_array_unref); } diff --git a/src/conn-avatars.c b/src/conn-avatars.c index 3a12ce2..44efa9d 100644 --- a/src/conn-avatars.c +++ b/src/conn-avatars.c @@ -421,7 +421,7 @@ parse_avatar (WockyNode *vcard, if (NULL == photo_node) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "contact vCard has no photo"); return FALSE; } @@ -441,7 +441,7 @@ parse_avatar (WockyNode *vcard, if (NULL == binval_node) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "contact avatar is missing binval node"); return FALSE; } @@ -450,7 +450,7 @@ parse_avatar (WockyNode *vcard, if (NULL == binval_value) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "contact avatar is missing binval content"); return FALSE; } @@ -459,7 +459,7 @@ parse_avatar (WockyNode *vcard, if (NULL == *avatar) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "failed to decode avatar from base64"); return FALSE; } @@ -489,7 +489,7 @@ _request_avatar_cb (GabbleVCardManager *self, if (NULL == vcard) { - GError tp_error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError tp_error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, vcard_error->message }; if (vcard_error->domain == WOCKY_XMPP_ERROR) @@ -537,7 +537,7 @@ _request_avatar_cb (GabbleVCardManager *self, DEBUG ("treason uncloaked! avatar hash in presence does not match " "avatar in vCard for handle %u", handle); - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "avatar hash in presence does not match avatar in vCard"); dbus_g_method_return_error (context, error); g_error_free (error); @@ -755,7 +755,7 @@ _set_avatar_cb2 (GabbleVCardManager *manager, if (NULL == vcard) { - GError tp_error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError tp_error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, vcard_error->message }; /* Google Talk has been observed to return bad-request when the avatar is diff --git a/src/conn-contact-info.c b/src/conn-contact-info.c index a78f172..ace9d4e 100644 --- a/src/conn-contact-info.c +++ b/src/conn-contact-info.c @@ -484,7 +484,7 @@ _return_from_request_contact_info (WockyNode *vcard_node, if (NULL == vcard_node) { - GError tp_error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError tp_error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, vcard_error->message }; if (vcard_error->domain == WOCKY_XMPP_ERROR) @@ -650,7 +650,7 @@ conn_contact_info_new_edit (const VCardField *field, if (field->types[0] == NULL && field_params[0] != NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s vCard field expects no type-parameters", field->xmpp_name); gabble_vcard_manager_edit_info_free (edit_info); return NULL; @@ -681,7 +681,7 @@ conn_contact_info_new_edit (const VCardField *field, if (!used) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s vCard field does not support type-parameter %s", field->xmpp_name, *p); gabble_vcard_manager_edit_info_free (edit_info); @@ -703,7 +703,7 @@ _set_contact_info_cb (GabbleVCardManager *vcard_manager, if (vcard_node == NULL) { - GError tp_error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError tp_error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, vcard_error->message }; if (vcard_error->domain == WOCKY_XMPP_ERROR) @@ -763,7 +763,7 @@ gabble_connection_set_contact_info (TpSvcConnectionInterfaceContactInfo *iface, if (field == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "unknown vCard field from D-Bus: %s", field_name); goto finally; } @@ -771,7 +771,7 @@ gabble_connection_set_contact_info (TpSvcConnectionInterfaceContactInfo *iface, if (!gabble_vcard_manager_can_use_vcard_field (self->vcard_manager, field->xmpp_name)) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s vCard field is not supported by this server", field->xmpp_name); goto finally; @@ -784,7 +784,7 @@ gabble_connection_set_contact_info (TpSvcConnectionInterfaceContactInfo *iface, { if (n_field_values != 1) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s vCard field expects one value but got %u", field->xmpp_name, n_field_values); goto finally; @@ -808,7 +808,7 @@ gabble_connection_set_contact_info (TpSvcConnectionInterfaceContactInfo *iface, if (n_field_values != n_elements) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s vCard field expects %u values but got %u", field->xmpp_name, n_elements, n_field_values); goto finally; @@ -834,7 +834,7 @@ gabble_connection_set_contact_info (TpSvcConnectionInterfaceContactInfo *iface, if (n_field_values == 0) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "ORG vCard field expects at least one value but got 0"); goto finally; } @@ -865,7 +865,7 @@ gabble_connection_set_contact_info (TpSvcConnectionInterfaceContactInfo *iface, if (n_field_values != 1) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s vCard field expects one value but got %u", field->xmpp_name, n_field_values); goto finally; diff --git a/src/conn-location.c b/src/conn-location.c index b9ac054..81fd0b3 100644 --- a/src/conn-location.c +++ b/src/conn-location.c @@ -263,7 +263,7 @@ add_to_geoloc_node (const gchar *tp_name, { if (G_VALUE_TYPE (value) != G_TYPE_STRING) { - g_set_error (err, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (err, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "expecting string for language value, but got %s", G_VALUE_TYPE_NAME (value)); return FALSE; @@ -286,7 +286,7 @@ add_to_geoloc_node (const gchar *tp_name, if (G_VALUE_TYPE (value) != mapping->type) { - g_set_error (err, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (err, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is supposed to be of type %s but is %s", (const char *) tp_name, g_type_name (mapping->type), G_VALUE_TYPE_NAME (value)); @@ -364,7 +364,7 @@ location_set_location (TpSvcConnectionInterfaceLocation *iface, if (!(conn->features & GABBLE_CONNECTION_FEATURES_PEP)) { - GError error = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + GError error = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Server does not support PEP, cannot publish geolocation" }; dbus_g_method_return_error (context, &error); @@ -395,7 +395,7 @@ location_set_location (TpSvcConnectionInterfaceLocation *iface, if (!_gabble_connection_send_with_reply (conn, msg, set_location_sent_cb, G_OBJECT (conn), context, NULL)) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send msg" }; dbus_g_method_return_error (context, &error); @@ -511,7 +511,7 @@ conn_location_properties_setter (GObject *object, if (access_control_type != TP_RICH_PRESENCE_ACCESS_CONTROL_TYPE_PUBLISH_LIST) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Access control type not implemented"); return FALSE; } diff --git a/src/conn-mail-notif.c b/src/conn-mail-notif.c index 2fe12e4..68d93ee 100644 --- a/src/conn-mail-notif.c +++ b/src/conn-mail-notif.c @@ -90,12 +90,12 @@ return_from_request_inbox_url (GabbleConnection *conn) if (priv->inbox_url != NULL && priv->inbox_url[0] == '\0') { - error = g_error_new (TP_ERRORS, TP_ERROR_NETWORK_ERROR, + error = g_error_new (TP_ERROR, TP_ERROR_NETWORK_ERROR, "Server did not provide base URL."); } else if (priv->inbox_url == NULL) { - error = g_error_new (TP_ERRORS, TP_ERROR_DISCONNECTED, + error = g_error_new (TP_ERROR, TP_ERROR_DISCONNECTED, "Connection was disconnected during request."); } else @@ -143,7 +143,7 @@ check_supported_or_dbus_return (GabbleConnection *conn, { if (TP_BASE_CONNECTION (conn)->status != TP_CONNECTION_STATUS_CONNECTED) { - GError e = { TP_ERRORS, TP_ERROR_DISCONNECTED, "Not connected" }; + GError e = { TP_ERROR, TP_ERROR_DISCONNECTED, "Not connected" }; dbus_g_method_return_error (context, &e); return TRUE; } @@ -220,7 +220,7 @@ gabble_mail_notification_request_mail_url ( } else { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to retrieve URL from server."}; dbus_g_method_return_error (context, &error); } diff --git a/src/conn-olpc.c b/src/conn-olpc.c index 243d2df..a935e9a 100644 --- a/src/conn-olpc.c +++ b/src/conn-olpc.c @@ -129,7 +129,7 @@ check_pep (GabbleConnection *conn, { if (!(conn->features & GABBLE_CONNECTION_FEATURES_PEP)) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Server does not support PEP" }; DEBUG ("%s", error.message); @@ -277,7 +277,7 @@ get_properties_reply_cb (GObject *source, NULL, &error); if (reply_msg == NULL) { - GError err = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError err = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property request to server" }; DEBUG ("Query failed: %s", error->message); @@ -379,7 +379,7 @@ transmit_properties (GabbleConnection *conn, if (!_gabble_connection_send_with_reply (conn, msg, set_properties_reply_cb, NULL, context, NULL)) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property change request to server" }; DEBUG ("%s", error.message); @@ -824,7 +824,7 @@ get_activities_reply_cb (GObject *source, NULL, &err); if (reply_msg == NULL) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property request to server" }; DEBUG ("Query failed: %s", err->message); @@ -838,7 +838,7 @@ get_activities_reply_cb (GObject *source, wocky_stanza_get_top_node (reply_msg), "from"); if (from == NULL) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Error in pubsub reply: no sender" }; dbus_g_method_return_error (ctx->context, &error); @@ -848,7 +848,7 @@ get_activities_reply_cb (GObject *source, from_handle = tp_handle_lookup (contact_repo, from, NULL, NULL); if (from_handle == 0) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Error in pubsub reply: unknown sender" }; dbus_g_method_return_error (ctx->context, &error); @@ -965,7 +965,7 @@ upload_activities_pep (GabbleConnection *conn, if (!ret) { - g_set_error (error, TP_ERRORS, TP_ERROR_NETWORK_ERROR, + g_set_error (error, TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property change request to server: %s", e->message); g_error_free (e); } @@ -1012,7 +1012,7 @@ add_activity (GabbleConnection *self, if (old_activities != NULL && tp_handle_set_is_member (old_activities, channel)) { - *error = g_error_new (TP_ERRORS, + *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't set twice the same activity: %s", id); @@ -1109,7 +1109,7 @@ olpc_buddy_info_set_activities (GabbleSvcOLPCBuddyInfo *iface, { if (tp_handle_set_is_member (activities_set, channel)) { - error = g_error_new (TP_ERRORS, + error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't set twice the same activity: %s", room); @@ -1161,7 +1161,7 @@ olpc_buddy_info_set_activities (GabbleSvcOLPCBuddyInfo *iface, if (!upload_activities_pep (conn, set_activities_reply_cb, context, NULL)) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property request to server" }; dbus_g_method_return_error (context, &error); @@ -1336,7 +1336,7 @@ get_current_activity_reply_cb (GObject *source, NULL, &error); if (reply_msg == NULL) { - GError err = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError err = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property request to server" }; DEBUG ("Query failed: %s", error->message); @@ -1501,7 +1501,7 @@ olpc_buddy_info_set_current_activity (GabbleSvcOLPCBuddyInfo *iface, if (!activity_in_own_set (conn, room)) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't set an activity as current if you're not announcing it" }; dbus_g_method_return_error (context, &error); @@ -1522,7 +1522,7 @@ olpc_buddy_info_set_current_activity (GabbleSvcOLPCBuddyInfo *iface, if (!_gabble_connection_send_with_reply (conn, msg, set_current_activity_reply_cb, NULL, context, NULL)) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property change request to server" }; dbus_g_method_return_error (context, &error); @@ -1634,7 +1634,7 @@ olpc_buddy_info_add_activity (GabbleSvcOLPCBuddyInfo *iface, if (!upload_activities_pep (self, add_activity_reply_cb, context, NULL)) { - error = g_error_new (TP_ERRORS, TP_ERROR_NETWORK_ERROR, + error = g_error_new (TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property request to server"); dbus_g_method_return_error (context, error); @@ -1697,7 +1697,7 @@ upload_activity_properties_pep (GabbleConnection *conn, if (!ret) { - g_set_error (error, TP_ERRORS, TP_ERROR_NETWORK_ERROR, + g_set_error (error, TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property change request to server: %s", e->message); g_error_free (e); } @@ -1853,7 +1853,7 @@ olpc_activity_properties_set_properties (GabbleSvcOLPCActivityProperties *iface, if (!activity_in_own_set (conn, jid)) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't set properties on an activity if you're not announcing it" }; dbus_g_method_return_error (context, &error); @@ -1870,7 +1870,7 @@ olpc_activity_properties_set_properties (GabbleSvcOLPCActivityProperties *iface, } if (muc_channel == NULL || state != MUC_STATE_JOINED) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't set properties on an activity if you're not in it" }; dbus_g_method_return_error (context, &error); @@ -1898,7 +1898,7 @@ olpc_activity_properties_set_properties (GabbleSvcOLPCActivityProperties *iface, wocky_stanza_get_top_node (msg), FALSE); if (!_gabble_connection_send (conn, msg, NULL)) { - GError error = { TP_ERRORS, TP_ERROR_NETWORK_ERROR, + GError error = { TP_ERROR, TP_ERROR_NETWORK_ERROR, "Failed to send property change notification to chatroom" }; g_object_unref (msg); @@ -3046,7 +3046,7 @@ olpc_activity_properties_get_activity (GabbleSvcOLPCActivityProperties *iface, activity = find_activity_by_id (self, activity_id); if (activity == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Activity unknown: %s", activity_id); goto error; } diff --git a/src/conn-presence.c b/src/conn-presence.c index 9dfd6b6..1f1809e 100644 --- a/src/conn-presence.c +++ b/src/conn-presence.c @@ -1100,7 +1100,7 @@ get_existing_privacy_lists_cb (GabbleConnection *conn, else if (query_node == NULL) { g_simple_async_result_set_error (result, - TP_ERRORS, TP_ERROR_NETWORK_ERROR, + TP_ERROR, TP_ERROR_NETWORK_ERROR, "no node in 'list privacy lists' reply"); } else @@ -1764,7 +1764,7 @@ set_own_status_cb (GObject *obj, * with the check enabled). Assumes PresenceId value ordering. */ if (i < GABBLE_PRESENCE_HIDDEN) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Status '%s' can not be requested in this connection", gabble_statuses[i].name); retval = FALSE; @@ -1782,7 +1782,7 @@ set_own_status_cb (GObject *obj, if (!G_VALUE_HOLDS_STRING (message)) { DEBUG ("got a status message which was not a string"); - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Status argument 'message' requires a string"); retval = FALSE; goto OUT; @@ -1795,7 +1795,7 @@ set_own_status_cb (GObject *obj, if (!G_VALUE_HOLDS_INT (priority)) { DEBUG ("got a priority value which was not a signed integer"); - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Status argument 'priority' requires a signed integer"); retval = FALSE; goto OUT; diff --git a/src/conn-sidecars.c b/src/conn-sidecars.c index 39c3c00..a110dc1 100644 --- a/src/conn-sidecars.c +++ b/src/conn-sidecars.c @@ -155,7 +155,7 @@ create_sidecar_cb ( { /* TODO: maybe this lives in the loader? It knows what the plugin is * called. */ - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "A buggy plugin created a %s sidecar when asked to create %s", actual_iface, ctx->sidecar_iface); } @@ -208,7 +208,7 @@ gabble_connection_ensure_sidecar ( if (base_conn->status == TP_CONNECTION_STATUS_DISCONNECTED) { - GError e = { TP_ERRORS, TP_ERROR_DISCONNECTED, + GError e = { TP_ERROR, TP_ERROR_DISCONNECTED, "This connection has already disconnected" }; DEBUG ("already disconnected, declining request for %s", sidecar_iface); @@ -218,7 +218,7 @@ gabble_connection_ensure_sidecar ( if (!tp_dbus_check_valid_interface_name (sidecar_iface, &error)) { - error->domain = TP_ERRORS; + error->domain = TP_ERROR; error->code = TP_ERROR_INVALID_ARGUMENT; DEBUG ("%s is malformed: %s", sidecar_iface, error->message); dbus_g_method_return_error (context, error); @@ -303,7 +303,7 @@ sidecars_conn_status_changed_cb ( { const gchar *sidecar_iface = key; GList *contexts = value; - GError *error = g_error_new (TP_ERRORS, TP_ERROR_CANCELLED, + GError *error = g_error_new (TP_ERROR, TP_ERROR_CANCELLED, "Disconnected before %s could be created", sidecar_iface); DEBUG ("failing all %u requests for %s", g_list_length (contexts), diff --git a/src/connection.c b/src/connection.c index c1e5946..ac46929 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1398,7 +1398,7 @@ _gabble_connection_set_properties_from_account (GabbleConnection *conn, if (!wocky_decode_jid (account, &username, &server, &resource)) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "unable to extract JID from account name"); result = FALSE; goto OUT; @@ -1484,7 +1484,7 @@ _gabble_connection_send (GabbleConnection *conn, WockyStanza *msg, GError **erro if (conn->priv->porter == NULL) { - g_set_error_literal (error, TP_ERRORS, TP_ERROR_NETWORK_ERROR, + g_set_error_literal (error, TP_ERROR, TP_ERROR_NETWORK_ERROR, "connection is disconnected"); return FALSE; } @@ -1600,7 +1600,7 @@ _gabble_connection_send_with_reply (GabbleConnection *conn, if (priv->porter == NULL) { - g_set_error_literal (error, TP_ERRORS, TP_ERROR_NETWORK_ERROR, + g_set_error_literal (error, TP_ERROR, TP_ERROR_NETWORK_ERROR, "connection is disconnected"); return FALSE; } @@ -1647,7 +1647,7 @@ gabble_connection_disconnect_with_tp_error (GabbleConnection *self, "debug-message", G_TYPE_STRING, tp_error->message, NULL); - g_assert (tp_error->domain == TP_ERRORS); + g_assert (tp_error->domain == TP_ERROR); tp_base_connection_disconnect_with_dbus_error (base, tp_error_get_dbus_name (tp_error->code), details, reason); g_hash_table_unref (details); @@ -1658,7 +1658,7 @@ remote_closed_cb (WockyPorter *porter, GabbleConnection *self) { TpBaseConnection *base = TP_BASE_CONNECTION (self); - GError e = { TP_ERRORS, TP_ERROR_CONNECTION_LOST, + GError e = { TP_ERROR, TP_ERROR_CONNECTION_LOST, "server closed its XMPP stream" }; if (base->status == TP_CONNECTION_STATUS_DISCONNECTED) @@ -1713,7 +1713,7 @@ remote_error_cb (WockyPorter *porter, return; gabble_set_tp_conn_error_from_wocky (&e, base->status, &reason, &error); - g_assert (error->domain == TP_ERRORS); + g_assert (error->domain == TP_ERROR); DEBUG ("Force closing of the connection %p", self); priv->closing = TRUE; @@ -1770,7 +1770,7 @@ connector_error_disconnect (GabbleConnection *self, gabble_set_tp_conn_error_from_wocky (error, base->status, &reason, &tp_error); DEBUG ("connection failed: %s", tp_error->message); - g_assert (tp_error->domain == TP_ERRORS); + g_assert (tp_error->domain == TP_ERROR); gabble_connection_disconnect_with_tp_error (self, tp_error, reason); g_error_free (tp_error); @@ -1962,9 +1962,9 @@ connector_connected (GabbleConnection *self, { DEBUG ("couldn't get our self handle: %s", error->message); - if (error->domain != TP_ERRORS) + if (error->domain != TP_ERROR) { - error->domain = TP_ERRORS; + error->domain = TP_ERROR; error->code = TP_ERROR_INVALID_HANDLE; } @@ -1980,9 +1980,9 @@ connector_connected (GabbleConnection *self, { DEBUG ("couldn't parse our own JID: %s", error->message); - if (error->domain != TP_ERRORS) + if (error->domain != TP_ERROR) { - error->domain = TP_ERRORS; + error->domain = TP_ERROR; error->code = TP_ERROR_INVALID_ARGUMENT; } @@ -2008,9 +2008,9 @@ connector_connected (GabbleConnection *self, DEBUG ("sending disco request failed: %s", error->message); - if (error->domain != TP_ERRORS) + if (error->domain != TP_ERROR) { - error->domain = TP_ERRORS; + error->domain = TP_ERROR; error->code = TP_ERROR_NETWORK_ERROR; } @@ -2027,9 +2027,9 @@ connector_connected (GabbleConnection *self, DEBUG ("Sending disco request to our own bare jid failed: %s", error->message); - if (error->domain != TP_ERRORS) + if (error->domain != TP_ERROR) { - error->domain = TP_ERRORS; + error->domain = TP_ERROR; error->code = TP_ERROR_NETWORK_ERROR; } diff --git a/src/error.c b/src/error.c index e79ddef..ad3bf7b 100644 --- a/src/error.c +++ b/src/error.c @@ -344,7 +344,7 @@ gabble_set_tp_conn_error_from_wocky (const GError *wocky_error, klass = g_type_class_ref (WOCKY_TYPE_XMPP_ERROR); name = get_error_prefix (klass, wocky_error->code, "unknown WockyXmppError code"); - g_set_error (error, TP_ERRORS, + g_set_error (error, TP_ERROR, map_wocky_xmpp_error (wocky_error, conn_reason), "%s (#%d): %s", name, wocky_error->code, wocky_error->message); g_type_class_unref (klass); @@ -356,7 +356,7 @@ gabble_set_tp_conn_error_from_wocky (const GError *wocky_error, "unknown GIOError code"); /* FIXME: is it safe to assume that every GIOError we encounter from * Wocky is a NetworkError? */ - g_set_error (error, TP_ERRORS, TP_ERROR_NETWORK_ERROR, + g_set_error (error, TP_ERROR, TP_ERROR_NETWORK_ERROR, "%s (#%d): %s", name, wocky_error->code, wocky_error->message); g_type_class_unref (klass); @@ -368,7 +368,7 @@ gabble_set_tp_conn_error_from_wocky (const GError *wocky_error, klass = g_type_class_ref (WOCKY_TYPE_AUTH_ERROR); name = get_error_prefix (klass, wocky_error->code, "unknown WockyAuthError code"); - g_set_error (error, TP_ERRORS, + g_set_error (error, TP_ERROR, map_wocky_auth_error (wocky_error, conn_reason), "%s (#%d): %s", name, wocky_error->code, wocky_error->message); g_type_class_unref (klass); @@ -378,7 +378,7 @@ gabble_set_tp_conn_error_from_wocky (const GError *wocky_error, klass = g_type_class_ref (WOCKY_TYPE_CONNECTOR_ERROR); name = get_error_prefix (klass, wocky_error->code, "unknown WockyConnectorError code"); - g_set_error (error, TP_ERRORS, + g_set_error (error, TP_ERROR, map_wocky_connector_error (wocky_error, conn_reason), "%s (#%d): %s", name, wocky_error->code, wocky_error->message); g_type_class_unref (klass); @@ -388,7 +388,7 @@ gabble_set_tp_conn_error_from_wocky (const GError *wocky_error, klass = g_type_class_ref (WOCKY_TYPE_XMPP_STREAM_ERROR); name = get_error_prefix (klass, wocky_error->code, "unknown WockyXmppStreamError code"); - g_set_error (error, TP_ERRORS, + g_set_error (error, TP_ERROR, map_wocky_stream_error (wocky_error, previous_status, conn_reason), "%s (#%d): %s", name, wocky_error->code, wocky_error->message); g_type_class_unref (klass); @@ -398,7 +398,7 @@ gabble_set_tp_conn_error_from_wocky (const GError *wocky_error, klass = g_type_class_ref (WOCKY_TYPE_TLS_CERT_STATUS); name = get_error_prefix (klass, wocky_error->code, "unknown WockyTLSCertStatus code"); - g_set_error (error, TP_ERRORS, + g_set_error (error, TP_ERROR, map_wocky_tls_cert_error (wocky_error, conn_reason), "%s (#%d): %s", name, wocky_error->code, wocky_error->message); g_type_class_unref (klass); @@ -406,14 +406,14 @@ gabble_set_tp_conn_error_from_wocky (const GError *wocky_error, else if (wocky_error->domain == WOCKY_XMPP_CONNECTION_ERROR) { /* FIXME: there's no GEnum for WockyXmppConnectionError. */ - g_set_error_literal (error, TP_ERRORS, + g_set_error_literal (error, TP_ERROR, map_connection_error (wocky_error), wocky_error->message); } else { /* best we can do... */ - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "%s (#%d): %s", g_quark_to_string (wocky_error->domain), wocky_error->code, wocky_error->message); } diff --git a/src/ft-channel.c b/src/ft-channel.c index 57b8912..b5c2419 100644 --- a/src/ft-channel.c +++ b/src/ft-channel.c @@ -481,21 +481,21 @@ file_transfer_channel_properties_setter (GObject *object, if (self->priv->uri != NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "URI has already be set"); return FALSE; } if (tp_base_channel_is_requested (base)) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Channel is not an incoming transfer"); return FALSE; } if (self->priv->state != TP_FILE_TRANSFER_STATE_PENDING) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "State is not pending; cannot set URI"); return FALSE; } @@ -931,7 +931,7 @@ check_address_and_access_control (GabbleFileTransferChannel *self, GUINT_TO_POINTER (address_type)); if (access_arr == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "AddressType %u is not implemented", address_type); return FALSE; } @@ -946,7 +946,7 @@ check_address_and_access_control (GabbleFileTransferChannel *self, return TRUE; } - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "AccesControl %u is not implemented with AddressType %u", access_control, address_type); @@ -1410,7 +1410,7 @@ gabble_file_transfer_channel_offer_file (GabbleFileTransferChannel *self, if (presence == NULL) { DEBUG ("can't find contact's presence"); - g_set_error (error, TP_ERRORS, TP_ERROR_OFFLINE, + g_set_error (error, TP_ERROR, TP_ERROR_OFFLINE, "can't find contact's presence"); return FALSE; @@ -1422,7 +1422,7 @@ gabble_file_transfer_channel_offer_file (GabbleFileTransferChannel *self, { DEBUG ("trying to use Metadata properties on a contact " "who doesn't support it"); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_CAPABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "The specified contact does not support the " "Metadata extension; you should ensure both ServiceName and " "Metadata properties are not present in the channel " @@ -1490,7 +1490,7 @@ gabble_file_transfer_channel_offer_file (GabbleFileTransferChannel *self, else { DEBUG ("contact doesn't have file transfer capabilities"); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_CAPABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "contact doesn't have file transfer capabilities"); result = FALSE; } @@ -1698,7 +1698,7 @@ gabble_file_transfer_channel_accept_file (TpSvcChannelTypeFileTransfer *iface, if (tp_base_channel_is_requested (base)) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Channel is not an incoming transfer"); dbus_g_method_return_error (context, error); g_error_free (error); @@ -1707,7 +1707,7 @@ gabble_file_transfer_channel_accept_file (TpSvcChannelTypeFileTransfer *iface, if (self->priv->state != TP_FILE_TRANSFER_STATE_PENDING) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "State is not pending; cannot accept file"); dbus_g_method_return_error (context, error); g_error_free (error); @@ -1726,7 +1726,7 @@ gabble_file_transfer_channel_accept_file (TpSvcChannelTypeFileTransfer *iface, access_control_param)) { DEBUG ("Could not set up local socket"); - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Could not set up local socket"); dbus_g_method_return_error (context, error); g_error_free (error); @@ -1798,7 +1798,7 @@ gabble_file_transfer_channel_provide_file ( if (!tp_base_channel_is_requested (TP_BASE_CHANNEL (self))) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Channel is not an outgoing transfer"); dbus_g_method_return_error (context, error); g_error_free (error); @@ -1808,7 +1808,7 @@ gabble_file_transfer_channel_provide_file ( if (self->priv->state != TP_FILE_TRANSFER_STATE_PENDING && self->priv->state != TP_FILE_TRANSFER_STATE_ACCEPTED) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "State is not pending or accepted; cannot provide file"); dbus_g_method_return_error (context, error); g_error_free (error); @@ -1817,7 +1817,7 @@ gabble_file_transfer_channel_provide_file ( if (self->priv->socket_address != NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "ProvideFile has already been called for this channel"); dbus_g_method_return_error (context, error); g_error_free (error); @@ -1836,7 +1836,7 @@ gabble_file_transfer_channel_provide_file ( access_control_param)) { DEBUG ("Could not set up local socket"); - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Could not set up local socket"); dbus_g_method_return_error (context, error); g_error_free (error); diff --git a/src/ft-manager.c b/src/ft-manager.c index a6bb130..b8b09d6 100644 --- a/src/ft-manager.c +++ b/src/ft-manager.c @@ -493,7 +493,7 @@ gabble_ft_manager_handle_request (TpChannelManager *manager, /* Don't support opening a channel to our self handle */ if (handle == base_connection->self_handle) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Can't open a file transfer channel to yourself"); goto error; } @@ -502,7 +502,7 @@ gabble_ft_manager_handle_request (TpChannelManager *manager, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER ".ContentType"); if (content_type == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "ContentType property is mandatory"); goto error; } @@ -511,7 +511,7 @@ gabble_ft_manager_handle_request (TpChannelManager *manager, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER ".Filename"); if (filename == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Filename property is mandatory"); goto error; } @@ -520,7 +520,7 @@ gabble_ft_manager_handle_request (TpChannelManager *manager, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER ".Size", NULL); if (size == 0) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Size property is mandatory"); goto error; } @@ -536,7 +536,7 @@ gabble_ft_manager_handle_request (TpChannelManager *manager, { if (content_hash_type >= NUM_TP_FILE_HASH_TYPES) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%u is not a valid ContentHashType", content_hash_type); goto error; } @@ -548,7 +548,7 @@ gabble_ft_manager_handle_request (TpChannelManager *manager, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER ".ContentHash"); if (content_hash == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "ContentHash property is mandatory if ContentHashType is " "not None"); goto error; @@ -580,7 +580,7 @@ gabble_ft_manager_handle_request (TpChannelManager *manager, if (metadata != NULL && g_hash_table_lookup ((GHashTable *) metadata, "FORM_TYPE")) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Metadata cannot contain an item with key 'FORM_TYPE'"); goto error; } diff --git a/src/im-channel.c b/src/im-channel.c index d294c3a..ba1f45d 100644 --- a/src/im-channel.c +++ b/src/im-channel.c @@ -632,12 +632,12 @@ gabble_im_channel_set_chat_state (TpSvcChannelInterfaceChatState *iface, if (state >= NUM_TP_CHANNEL_CHAT_STATES) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid state: %u", state); } else if (state == TP_CHANNEL_CHAT_STATE_GONE) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "you may not explicitly set the Gone state"); } /* Only send anything to the peer if we actually know they support chat diff --git a/src/im-factory.c b/src/im-factory.c index 0459c2d..72c3395 100644 --- a/src/im-factory.c +++ b/src/im-factory.c @@ -704,7 +704,7 @@ gabble_im_factory_requestotron (GabbleImFactory *self, if (require_new) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Already chatting with contact #%u in another channel", handle); goto error; } diff --git a/src/media-channel.c b/src/media-channel.c index 0721b29..4449c92 100644 --- a/src/media-channel.c +++ b/src/media-channel.c @@ -1279,7 +1279,7 @@ _find_stream_by_id (GabbleMediaChannel *chan, return stream; } - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "given stream id %u does not exist", stream_id); return NULL; } @@ -1331,7 +1331,7 @@ gabble_media_channel_remove_streams (TpSvcChannelTypeStreamedMedia *iface, if (!gabble_jingle_session_can_modify_contents (priv->session)) { - GError e = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + GError e = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Streams can't be removed from Google Talk calls" }; dbus_g_method_return_error (context, &e); return; @@ -1426,7 +1426,7 @@ gabble_media_channel_request_stream_direction (TpSvcChannelTypeStreamedMedia *if if (stream_direction > TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "given stream direction %u is not valid", stream_direction); dbus_g_method_return_error (context, error); g_error_free (error); @@ -1464,7 +1464,7 @@ gabble_media_channel_request_stream_direction (TpSvcChannelTypeStreamedMedia *if } else { - GError e = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + GError e = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Stream direction can't be set to None in Google Talk calls" }; DEBUG ("%s", e.message); dbus_g_method_return_error (context, &e); @@ -1570,7 +1570,7 @@ pending_stream_request_maybe_fail (PendingStreamRequest *p, { if (content == p->contents[i]) { - GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "A stream was removed before it could be fully set up" }; /* return early */ @@ -1590,7 +1590,7 @@ pending_stream_request_free (gpointer data) if (p->context != NULL) { - GError e = { TP_ERRORS, TP_ERROR_CANCELLED, + GError e = { TP_ERROR, TP_ERROR_CANCELLED, "The session terminated before the requested streams could be added" }; @@ -1635,7 +1635,7 @@ _gabble_media_channel_request_contents (GabbleMediaChannel *chan, } else { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "given media type %u is invalid", media_type); return FALSE; } @@ -1654,7 +1654,7 @@ _gabble_media_channel_request_contents (GabbleMediaChannel *chan, /* is a google call... we have no other option */ if (!gabble_jingle_session_can_modify_contents (priv->session)) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Streams can't be added to ongoing Google Talk calls"); return FALSE; } @@ -1665,7 +1665,7 @@ _gabble_media_channel_request_contents (GabbleMediaChannel *chan, peer_resource, want_audio ? JINGLE_MEDIA_TYPE_AUDIO : JINGLE_MEDIA_TYPE_VIDEO)) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "member does not have the desired audio/video capabilities"); return FALSE; @@ -1699,7 +1699,7 @@ _gabble_media_channel_request_contents (GabbleMediaChannel *chan, if (!jingle_pick_best_resource (priv->conn, peer, want_audio, want_video, &transport_ns, &dialect, &peer_resource)) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_CAPABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "member does not have the desired audio/video capabilities"); return FALSE; } @@ -1729,7 +1729,7 @@ _gabble_media_channel_request_contents (GabbleMediaChannel *chan, /* check it's not a ridiculous number of streams */ if ((priv->streams->len + media_types->len) > MAX_STREAMS) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "I think that's quite enough streams already"); return FALSE; } @@ -1790,7 +1790,7 @@ destroy_request (struct _delayed_request_streams_ctx *ctx, if (ctx->context != NULL) { GError *error = NULL; - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "cannot add streams: peer has insufficient caps"); ctx->failed_cb (ctx->context, error); g_error_free (error); @@ -1917,7 +1917,7 @@ media_channel_request_streams (GabbleMediaChannel *self, if (priv->peer != 0 && priv->peer != contact_handle) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "cannot add streams for %u: this channel's peer is %u", contact_handle, priv->peer); goto error; @@ -2080,11 +2080,11 @@ contact_is_media_capable (GabbleMediaChannel *chan, *wait_ret = wait; if (presence == NULL) - g_set_error (error, TP_ERRORS, TP_ERROR_OFFLINE, + g_set_error (error, TP_ERROR, TP_ERROR_OFFLINE, "contact %d (%s) has no presence available", peer, tp_handle_inspect (contact_handles, peer)); else - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_CAPABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "contact %d (%s) doesn't have sufficient media caps", peer, tp_handle_inspect (contact_handles, peer)); @@ -2113,7 +2113,7 @@ gabble_media_channel_add_member (GObject *obj, */ if (priv->peer != 0 && priv->peer != handle) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "handle %u cannot be added: this channel's peer is %u", handle, priv->peer); return FALSE; @@ -2160,7 +2160,7 @@ gabble_media_channel_add_member (GObject *obj, /* is the call on hold? */ if (priv->hold_state != TP_LOCAL_HOLD_STATE_UNHELD) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Can't answer a call while it's on hold"); return FALSE; } @@ -2182,7 +2182,7 @@ gabble_media_channel_add_member (GObject *obj, } } - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "handle %u cannot be added in the current state", handle); return FALSE; } @@ -2233,7 +2233,7 @@ gabble_media_channel_remove_member (GObject *obj, jingle_reason = JINGLE_REASON_TIMEOUT; break; default: - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%u doesn't make sense as a reason to end a call", reason); g_object_unref (chan); return FALSE; @@ -2966,7 +2966,7 @@ gabble_media_channel_ready (TpSvcMediaSessionHandler *iface, * error message describes the only legitimate situation in which this * could arise. */ - GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "call has already ended" }; + GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "call has already ended" }; DEBUG ("no session, returning an error."); dbus_g_method_return_error (context, &e); @@ -3013,7 +3013,7 @@ gabble_media_channel_error (TpSvcMediaSessionHandler *iface, * error message describes the only legitimate situation in which this * could arise. */ - GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, "call has already ended" }; + GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "call has already ended" }; DEBUG ("no session, returning an error."); dbus_g_method_return_error (context, &e); diff --git a/src/media-factory.c b/src/media-factory.c index b52cfc6..7b7a00b 100644 --- a/src/media-factory.c +++ b/src/media-factory.c @@ -776,7 +776,7 @@ gabble_media_factory_requestotron (TpChannelManager *manager, if (require_target_handle) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "A valid Contact handle must be provided when requesting a media " "channel"); goto error; @@ -918,7 +918,7 @@ gabble_media_factory_create_call (TpChannelManager *manager, if (!initial_audio && !initial_video) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Call channel must contain at least " "one of InitialAudio or InitialVideo"); goto error; diff --git a/src/media-stream.c b/src/media-stream.c index cf94c97..d3b1b55 100644 --- a/src/media-stream.c +++ b/src/media-stream.c @@ -1196,7 +1196,7 @@ pass_local_codecs (GabbleMediaStream *stream, GABBLE_JINGLE_MEDIA_RTP (priv->content), md, ready, &wocky_error)) return TRUE; - g_set_error_literal (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error_literal (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, wocky_error->message); g_clear_error (&wocky_error); return FALSE; @@ -1302,7 +1302,7 @@ gabble_media_stream_supported_codecs (TpSvcMediaStreamHandler *iface, if (codecs->len == 0) { - GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "SupportedCodecs must have a non-empty list of codecs" }; dbus_g_method_return_error (context, &e); @@ -1355,7 +1355,7 @@ gabble_media_stream_codecs_updated (TpSvcMediaStreamHandler *iface, if (!self->priv->local_codecs_set) { - GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "CodecsUpdated may only be called once an initial set of codecs " "has been set" }; @@ -1979,7 +1979,7 @@ gabble_media_stream_change_direction (GabbleMediaStream *stream, if (!gabble_jingle_content_change_direction (priv->content, senders)) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "stream direction invalid for the Jingle dialect in use"); return FALSE; } diff --git a/src/message-util.c b/src/message-util.c index ee9c1d0..a272a17 100644 --- a/src/message-util.c +++ b/src/message-util.c @@ -102,7 +102,7 @@ gabble_message_util_build_stanza (TpMessage *message, #define RETURN_INVALID_ARGUMENT(msg, ...) \ G_STMT_START { \ DEBUG (msg , ## __VA_ARGS__); \ - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, \ + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, \ msg , ## __VA_ARGS__); \ return NULL; \ } G_STMT_END diff --git a/src/muc-channel.c b/src/muc-channel.c index 93ab206..76c50e2 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -1473,7 +1473,7 @@ close_channel (GabbleMucChannel *chan, const gchar *reason, tp_base_channel_get_connection (base)); TpIntSet *set; GArray *handles; - GError error = { TP_ERRORS, TP_ERROR_CANCELLED, + GError error = { TP_ERROR, TP_ERROR_CANCELLED, "Muc channel closed below us" }; if (tp_base_channel_is_destroyed (base) || priv->closing) @@ -1577,7 +1577,7 @@ handle_nick_conflict (GabbleMucChannel *chan, if (priv->nick_retry_count >= MAX_NICK_RETRIES) { - g_set_error (tp_error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (tp_error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "nickname already in use and retry count exceeded"); return FALSE; } @@ -1800,18 +1800,18 @@ handle_error (GObject *source, switch (errnum) { case WOCKY_XMPP_ERROR_FORBIDDEN: - tp_error = g_error_new (TP_ERRORS, TP_ERROR_CHANNEL_BANNED, + tp_error = g_error_new (TP_ERROR, TP_ERROR_CHANNEL_BANNED, "banned from room"); reason = TP_CHANNEL_GROUP_CHANGE_REASON_BANNED; break; case WOCKY_XMPP_ERROR_SERVICE_UNAVAILABLE: - tp_error = g_error_new (TP_ERRORS, TP_ERROR_CHANNEL_FULL, + tp_error = g_error_new (TP_ERROR, TP_ERROR_CHANNEL_FULL, "room is full"); reason = TP_CHANNEL_GROUP_CHANGE_REASON_BUSY; break; case WOCKY_XMPP_ERROR_REGISTRATION_REQUIRED: - tp_error = g_error_new (TP_ERRORS, TP_ERROR_CHANNEL_INVITE_ONLY, + tp_error = g_error_new (TP_ERROR, TP_ERROR_CHANNEL_INVITE_ONLY, "room is invite only"); break; @@ -1821,7 +1821,7 @@ handle_error (GObject *source, break; default: - tp_error = g_error_new (TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + tp_error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "%s", wocky_xmpp_error_description (errnum)); break; } @@ -2782,7 +2782,7 @@ gabble_muc_channel_provide_password (TpSvcChannelInterfacePassword *iface, if (!priv->must_provide_password || priv->password_ctx != NULL) { - GError error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "password cannot be provided in the current state" }; dbus_g_method_return_error (context, &error); } @@ -2938,7 +2938,7 @@ gabble_muc_channel_add_member (GObject *obj, if (tp_handle_set_is_member (mixin->members, handle) || tp_handle_set_is_member (mixin->remote_pending, handle)) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "already a member or in remote pending"); return FALSE; @@ -2982,7 +2982,7 @@ gabble_muc_channel_add_member (GObject *obj, /* check that we're indeed a member when attempting to invite others */ if (priv->state < MUC_STATE_JOINED) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "channel membership is required for inviting others"); return FALSE; @@ -3346,7 +3346,7 @@ request_config_form_reply_cb ( "with WOCKY_DEBUG=xmpp)\n\n"); fflush (stdout); - error = g_error_new (TP_ERRORS, TP_ERROR_SERVICE_CONFUSED, + error = g_error_new (TP_ERROR, TP_ERROR_SERVICE_CONFUSED, "Couldn't find fields corresponding to %s in the muc#owner form. " "This is a MUC server compatibility bug in Gabble.", unsubstituted->str); @@ -3425,7 +3425,7 @@ gabble_muc_channel_set_chat_state (TpSvcChannelInterfaceChatState *iface, { DEBUG ("invalid state %u", state); - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid state: %u", state); } @@ -3434,7 +3434,7 @@ gabble_muc_channel_set_chat_state (TpSvcChannelInterfaceChatState *iface, /* We cannot explicitly set the Gone state */ DEBUG ("you may not explicitly set the Gone state"); - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "you may not explicitly set the Gone state"); } @@ -3687,7 +3687,7 @@ gabble_muc_channel_request_call (GabbleMucChannel *gmuc, { g_simple_async_report_error_in_idle (G_OBJECT (gmuc), callback, user_data, - TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + TP_ERROR, TP_ERROR_NOT_AVAILABLE, "A request for a call is already in progress"); return; } @@ -3783,21 +3783,21 @@ gabble_muc_channel_set_subject (TpSvcChannelInterfaceSubject *iface, if (priv->state < MUC_STATE_JOINED) { - GError error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Steady on. You're not in the room yet" }; dbus_g_method_return_error (context, &error); } else if (priv->state > MUC_STATE_JOINED || priv->closing) { - GError error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Already left/leaving the room" }; dbus_g_method_return_error (context, &error); } else if (priv->set_subject_context != NULL) { - GError error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Hey! Stop changing the subject! (Your last request is still in " "flight.)" }; diff --git a/src/muc-factory.c b/src/muc-factory.c index 4cc7e21..b982707 100644 --- a/src/muc-factory.c +++ b/src/muc-factory.c @@ -869,7 +869,7 @@ cancel_queued_requests (gpointer k, for (iter = requests_satisfied; iter != NULL; iter = iter->next) { tp_channel_manager_emit_request_failed (self, - iter->data, TP_ERRORS, TP_ERROR_DISCONNECTED, + iter->data, TP_ERROR, TP_ERROR_DISCONNECTED, "Unable to complete this channel request, we're disconnecting!"); } @@ -1436,7 +1436,7 @@ handle_text_channel_request (GabbleMucFactory *self, if (!ok) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "TargetID's node part (%s) doesn't match RoomName (%s)", target_room, room_name); ret = FALSE; @@ -1466,7 +1466,7 @@ handle_text_channel_request (GabbleMucFactory *self, if (!ok) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "TargetID's domain part (%s) doesn't match Server (%s)", target_server, server_prop); ret = FALSE; @@ -1486,7 +1486,7 @@ handle_text_channel_request (GabbleMucFactory *self, if (require_new) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "That channel has already been created (or requested)"); ret = FALSE; } @@ -1496,7 +1496,7 @@ handle_text_channel_request (GabbleMucFactory *self, initial_handles != NULL || initial_ids != NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Cannot set InitialChannels, InitialInviteeHandles or " "InitialInviteIDs for existing channel"); ret = FALSE; @@ -1583,7 +1583,7 @@ handle_tubes_channel_request (GabbleMucFactory *self, { if (require_new) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "That channel has already been created (or requested)"); return FALSE; } @@ -1712,7 +1712,7 @@ handle_stream_tube_channel_request (GabbleMucFactory *self, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE); if (service == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Request does not contain the mandatory property '%s'", TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE); return FALSE; @@ -1743,7 +1743,7 @@ handle_dbus_tube_channel_request (GabbleMucFactory *self, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME); if (service == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Request does not contain the mandatory property '%s'", TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME); return FALSE; @@ -1807,7 +1807,7 @@ handle_call_channel_request (GabbleMucFactory *self, if (!initial_audio && !initial_video) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Request didn't set either InitialAudio or InitialVideo"); return FALSE; } @@ -1820,7 +1820,7 @@ handle_call_channel_request (GabbleMucFactory *self, { if (require_new) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "There is already a call in this muc"); goto error; } diff --git a/src/plugin-loader.c b/src/plugin-loader.c index 61a005f..f08087e 100644 --- a/src/plugin-loader.c +++ b/src/plugin-loader.c @@ -299,7 +299,7 @@ gabble_plugin_loader_create_sidecar ( } g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, - TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, "No plugin implements sidecar '%s'", + TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "No plugin implements sidecar '%s'", sidecar_interface); } diff --git a/src/plugin.c b/src/plugin.c index dd0d730..a96bb91 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -108,17 +108,17 @@ gabble_plugin_create_sidecar_async ( if (!gabble_plugin_implements_sidecar (plugin, sidecar_interface)) g_simple_async_report_error_in_idle (G_OBJECT (plugin), callback, - user_data, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + user_data, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Gabble is buggy: '%s' doesn't implement sidecar %s", iface->name, sidecar_interface); else if (iface->create_sidecar_async == NULL) g_simple_async_report_error_in_idle (G_OBJECT (plugin), callback, - user_data, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + user_data, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' is buggy: it claims to implement %s, but does not implement " "create_sidecar_async", iface->name, sidecar_interface); else if (iface->create_sidecar_finish == NULL) g_simple_async_report_error_in_idle (G_OBJECT (plugin), callback, - user_data, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + user_data, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' is buggy: does not imlement create_sidecar_finish", iface->name); else diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c index ea418f2..2c781e5 100644 --- a/src/private-tubes-factory.c +++ b/src/private-tubes-factory.c @@ -932,7 +932,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE); if (service == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Request does not contain the mandatory property '%s'", TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE); goto error; @@ -954,7 +954,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME); if (service == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Request does not contain the mandatory property '%s'", TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME); goto error; @@ -963,7 +963,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self, if (!tp_dbus_check_valid_bus_name (service, TP_DBUS_NAME_TYPE_WELL_KNOWN, &err)) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid ServiceName: %s", err->message); g_error_free (err); goto error; @@ -978,7 +978,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self, /* Don't support opening a channel to our self handle */ if (handle == base_conn->self_handle) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Can't open a channel to your self handle"); goto error; } @@ -997,7 +997,7 @@ gabble_private_tubes_factory_requestotron (GabblePrivateTubesFactory *self, if (require_new) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Tubes channel with contact #%u already exists", handle); DEBUG ("Tubes channel with contact #%u already exists", handle); diff --git a/src/request-pipeline.c b/src/request-pipeline.c index 1bbfe4a..30c1dd4 100644 --- a/src/request-pipeline.c +++ b/src/request-pipeline.c @@ -245,7 +245,7 @@ gabble_request_pipeline_flush (GabbleRequestPipeline *self, GSList **list) { GabbleRequestPipelineItem *item; - GError disconnected = { TP_ERRORS, TP_ERROR_DISCONNECTED, + GError disconnected = { TP_ERROR, TP_ERROR_DISCONNECTED, "Request failed because connection became disconnected" }; while (*list != NULL) diff --git a/src/roomlist-manager.c b/src/roomlist-manager.c index 6f8d499..20e7c8a 100644 --- a/src/roomlist-manager.c +++ b/src/roomlist-manager.c @@ -329,7 +329,7 @@ gabble_roomlist_manager_handle_request (TpChannelManager *manager, if (tp_asv_get_uint32 (request_properties, TP_IFACE_CHANNEL ".TargetHandleType", NULL) != 0) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "RoomList channels can't have a target handle"); goto error; } @@ -349,7 +349,7 @@ gabble_roomlist_manager_handle_request (TpChannelManager *manager, if (server == NULL) { - g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Unable to choose a default conference server"); goto error; } diff --git a/src/roster.c b/src/roster.c index 7bd6758..96db7c2 100644 --- a/src/roster.c +++ b/src/roster.c @@ -3273,7 +3273,7 @@ gabble_roster_set_group_members_async (TpBaseContactList *base, /* You can't add people to an invalid group. */ if (G_UNLIKELY (group_handle == 0)) { - g_simple_async_result_set_error (result, TP_ERRORS, + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid group name: %s", group); goto finally; } @@ -3327,7 +3327,7 @@ gabble_roster_add_to_group_async (TpBaseContactList *base, /* You can't add people to an invalid group. */ if (G_UNLIKELY (group_handle == 0)) { - g_simple_async_result_set_error (result, TP_ERRORS, + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid group name: %s", group); goto finally; } diff --git a/src/search-channel.c b/src/search-channel.c index afbb098..94abbd9 100644 --- a/src/search-channel.c +++ b/src/search-channel.c @@ -234,7 +234,7 @@ parse_unextended_field_response ( } else { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "server is broken: %s is not a field defined in XEP 0055", field->name); g_ptr_array_unref (search_keys); @@ -272,7 +272,7 @@ parse_data_form ( if (tp_strdiff (wocky_node_get_attribute (x_node, "type"), "form")) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "server is broken: not type='form'"); goto fail; } @@ -308,7 +308,7 @@ parse_data_form ( if (tp_strdiff (form_type, NS_SEARCH)) { DEBUG (" form does not have FORM_TYPE %s", NS_SEARCH); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "server is broken: form lacking FORM_TYPE %s", NS_SEARCH); goto fail; } @@ -416,7 +416,7 @@ query_reply_cb (GabbleConnection *conn, } else if (NULL == query_node) { - err = g_error_new (TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + err = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "%s is broken: it replied to our with an empty IQ", chan->priv->server); } @@ -461,7 +461,7 @@ request_search_fields (GabbleSearchChannel *chan) * change_search_state: * @chan: a search channel * @state: the new state for the channel - * @reason: an error in the TP_ERRORS domain if the search has failed; NULL + * @reason: an error in the TP_ERROR domain if the search has failed; NULL * otherwise. */ static void @@ -493,7 +493,7 @@ change_search_state (GabbleSearchChannel *chan, if (state == TP_CHANNEL_CONTACT_SEARCH_STATE_FAILED) { g_assert (reason != NULL); - g_assert (reason->domain == TP_ERRORS); + g_assert (reason->domain == TP_ERROR); error_name = tp_error_get_dbus_name (reason->code); g_value_init (&v, G_TYPE_STRING); @@ -737,7 +737,7 @@ parse_extended_search_results (GabbleSearchChannel *chan, x = wocky_node_get_child_ns (query_node, "x", NS_X_DATA); if (x == NULL) { - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "reply doens't contain a node"); return FALSE; } @@ -802,7 +802,7 @@ search_reply_cb (GabbleConnection *conn, } else if (NULL == query_node) { - err = g_error_new (TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + err = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "%s is broken: its iq reply didn't contain a ", chan->priv->server); } @@ -848,7 +848,7 @@ validate_terms (GabbleSearchChannel *chan, if (!tp_strv_contains (asks, field)) { DEBUG ("%s is not in AvailableSearchKeys", field); - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s is not in AvailableSearchKeys", field); return FALSE; } @@ -1204,7 +1204,7 @@ gabble_search_channel_class_init (GabbleSearchChannelClass *klass) * server gave us a set of search keys, and they were sane, all components * will be 0 or %NULL, indicating that this channel can be announced and * used; if the server doesn't actually speak XEP 0055 or is full of bees, - * they'll be an error in either the GABBLE_XMPP_ERROR or the TP_ERRORS + * they'll be an error in either the GABBLE_XMPP_ERROR or the TP_ERROR * domain. */ signals[READY_OR_NOT] = @@ -1235,7 +1235,7 @@ gabble_search_channel_search (TpSvcChannelTypeContactSearch *self, if (priv->state != TP_CHANNEL_CONTACT_SEARCH_STATE_NOT_STARTED) { - error = g_error_new (TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "SearchState is %s", states[priv->state]); goto err; } @@ -1262,7 +1262,7 @@ gabble_search_channel_stop (TpSvcChannelTypeContactSearch *self, { case TP_CHANNEL_CONTACT_SEARCH_STATE_IN_PROGRESS: { - GError e = { TP_ERRORS, TP_ERROR_CANCELLED, "Stop() called" }; + GError e = { TP_ERROR, TP_ERROR_CANCELLED, "Stop() called" }; change_search_state (chan, TP_CHANNEL_CONTACT_SEARCH_STATE_FAILED, &e); @@ -1274,7 +1274,7 @@ gabble_search_channel_stop (TpSvcChannelTypeContactSearch *self, break; case TP_CHANNEL_CONTACT_SEARCH_STATE_NOT_STARTED: { - GError e = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Search() hasn't been called yet" }; dbus_g_method_return_error (context, &e); diff --git a/src/search-manager.c b/src/search-manager.c index c78598f..60f07fc 100644 --- a/src/search-manager.c +++ b/src/search-manager.c @@ -149,7 +149,7 @@ disco_done_cb (GabbleDisco *disco, else { tp_channel_manager_emit_request_failed (self, request_token, - TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "No Server has been specified and no server has been " "discovered on the connection"); } @@ -408,7 +408,7 @@ search_channel_ready_or_not_cb (GabbleSearchChannel *chan, { if (domain == WOCKY_XMPP_ERROR) { - domain = TP_ERRORS; + domain = TP_ERROR; switch (code) { @@ -424,7 +424,7 @@ search_channel_ready_or_not_cb (GabbleSearchChannel *chan, } else { - g_assert (domain == TP_ERRORS); + g_assert (domain == TP_ERROR); } tp_channel_manager_emit_request_failed (ctx->self, @@ -490,7 +490,7 @@ gabble_search_manager_create_channel (TpChannelManager *manager, else if (!wocky_decode_jid (server, NULL, NULL, NULL)) { /* On the other hand, if the JID's invalid, blow up. */ - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Specified server '%s' is not a valid JID", server); goto error; } @@ -501,7 +501,7 @@ gabble_search_manager_create_channel (TpChannelManager *manager, { if (self->priv->disco_done) { - error = g_error_new (TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "No Server has been specified and no server has been " "discovered on the connection"); goto error; diff --git a/src/server-sasl-channel.c b/src/server-sasl-channel.c index 961d6d4..7077420 100644 --- a/src/server-sasl-channel.c +++ b/src/server-sasl-channel.c @@ -470,7 +470,7 @@ gabble_server_sasl_channel_raise (DBusGMethodInvocation *context, GError *error = NULL; va_start (ap, message); - error = g_error_new_valist (TP_ERRORS, code, message, ap); + error = g_error_new_valist (TP_ERROR, code, message, ap); va_end (ap); dbus_g_method_return_error (context, error); @@ -924,7 +924,7 @@ gabble_server_sasl_channel_fail (GabbleServerSaslChannel *self, gabble_set_tp_conn_error_from_wocky (error, TP_CONNECTION_STATUS_CONNECTING, &conn_reason, &tp_error); - g_assert (tp_error->domain == TP_ERRORS); + g_assert (tp_error->domain == TP_ERROR); DEBUG ("auth failed: %s", tp_error->message); change_current_state (self, TP_SASL_STATUS_SERVER_FAILED, diff --git a/src/server-tls-manager.c b/src/server-tls-manager.c index 890a4d6..d4109b6 100644 --- a/src/server-tls-manager.c +++ b/src/server-tls-manager.c @@ -293,7 +293,7 @@ gabble_server_tls_manager_verify_async (WockyTLSHandler *handler, if (self->priv->connection == NULL) { DEBUG ("connection already went away; failing immediately"); - g_simple_async_result_set_error (result, TP_ERRORS, TP_ERROR_CANCELLED, + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_CANCELLED, "The Telepathy connection has already been disconnected"); g_simple_async_result_complete_in_idle (result); g_object_unref (result); diff --git a/src/tls-certificate.c b/src/tls-certificate.c index 6d57485..fabb541 100644 --- a/src/tls-certificate.c +++ b/src/tls-certificate.c @@ -266,7 +266,7 @@ gabble_tls_certificate_accept (TpSvcAuthenticationTLSCertificate *cert, if (self->priv->cert_state != TP_TLS_CERTIFICATE_STATE_PENDING) { GError error = - { TP_ERRORS, + { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Calling Accept() on a certificate with state != PENDING " "doesn't make sense." @@ -295,7 +295,7 @@ gabble_tls_certificate_reject (TpSvcAuthenticationTLSCertificate *cert, if (rejections->len < 1) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Calling Reject() with a zero-length rejection list." }; dbus_g_method_return_error (context, &error); @@ -305,7 +305,7 @@ gabble_tls_certificate_reject (TpSvcAuthenticationTLSCertificate *cert, if (self->priv->cert_state != TP_TLS_CERTIFICATE_STATE_PENDING) { GError error = - { TP_ERRORS, + { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Calling Reject() on a certificate with state != PENDING " "doesn't make sense." diff --git a/src/tube-dbus.c b/src/tube-dbus.c index 424bf3d..ebe26f4 100644 --- a/src/tube-dbus.c +++ b/src/tube-dbus.c @@ -394,7 +394,7 @@ create_dbus_server (GabbleTubeDBus *self, g_free (priv->socket_path); priv->socket_path = NULL; - g_set_error (err, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (err, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Can't create D-Bus server"); return FALSE; } @@ -1038,7 +1038,7 @@ gabble_tube_dbus_offer (GabbleTubeDBus *tube, if (priv->offered) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube has already been offered"); return FALSE; } @@ -1062,7 +1062,7 @@ gabble_tube_dbus_offer (GabbleTubeDBus *tube, if (presence == NULL) { DEBUG ("can't find contact %s's presence", jid); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "can't find contact %s's presence", jid); return FALSE; } @@ -1073,7 +1073,7 @@ gabble_tube_dbus_offer (GabbleTubeDBus *tube, if (resource == NULL) { DEBUG ("contact %s doesn't have tubes capabilities", jid); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "contact %s doesn't have tubes capabilities", jid); return FALSE; } @@ -1661,7 +1661,7 @@ gabble_tube_dbus_check_access_control (GabbleTubeDBus *self, break; default: - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%u socket access control is not supported", access_control); return FALSE; } diff --git a/src/tube-stream.c b/src/tube-stream.c index a505ef1..a315a2d 100644 --- a/src/tube-stream.c +++ b/src/tube-stream.c @@ -471,7 +471,7 @@ start_stream_initiation (GabbleTubeStream *self, if (presence == NULL) { DEBUG ("can't find initiator's presence"); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "can't find initiator's presence"); return FALSE; } @@ -481,7 +481,7 @@ start_stream_initiation (GabbleTubeStream *self, if (resource == NULL) { DEBUG ("initiator doesn't have tubes capabilities"); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "initiator doesn't have tubes capabilities"); return FALSE; } @@ -1665,7 +1665,7 @@ gabble_tube_stream_accept (GabbleTubeIface *tube, if (priv->state != TP_TUBE_CHANNEL_STATE_LOCAL_PENDING) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not in the local pending state"); goto fail; } @@ -1861,7 +1861,7 @@ check_unix_params (TpSocketAddressType address_type, { if (G_VALUE_TYPE (address) != DBUS_TYPE_G_UCHAR_ARRAY) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unix socket address is supposed to be ay"); return FALSE; } @@ -1870,7 +1870,7 @@ check_unix_params (TpSocketAddressType address_type, if (array->len > sizeof (dummy.sun_path) - 1) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unix socket path is too long (max length allowed: %" G_GSIZE_FORMAT ")", sizeof (dummy.sun_path) - 1); @@ -1881,7 +1881,7 @@ check_unix_params (TpSocketAddressType address_type, { if (g_array_index (array, gchar , i) == '\0') { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unix socket path can't contain zero bytes"); return FALSE; } @@ -1893,7 +1893,7 @@ check_unix_params (TpSocketAddressType address_type, { DEBUG ("Error calling stat on socket: %s", g_strerror (errno)); - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "%s: %s", + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s: %s", socket_address->str, g_strerror (errno)); g_string_free (socket_address, TRUE); return FALSE; @@ -1903,7 +1903,7 @@ check_unix_params (TpSocketAddressType address_type, { DEBUG ("%s is not a socket", socket_address->str); - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s is not a socket", socket_address->str); g_string_free (socket_address, TRUE); return FALSE; @@ -1919,7 +1919,7 @@ check_unix_params (TpSocketAddressType address_type, return TRUE; } - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%u socket access control is not supported", access_control); return FALSE; } @@ -1944,7 +1944,7 @@ check_ip_params (TpSocketAddressType address_type, { if (G_VALUE_TYPE (address) != TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "IPv4 socket address is supposed to be sq"); return FALSE; } @@ -1953,7 +1953,7 @@ check_ip_params (TpSocketAddressType address_type, { if (G_VALUE_TYPE (address) != TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "IPv6 socket address is supposed to be sq"); return FALSE; } @@ -1981,7 +1981,7 @@ check_ip_params (TpSocketAddressType address_type, ret = getaddrinfo (ip, NULL, &req, &result); if (ret != 0) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid address: %s", gai_strerror (ret)); g_free (ip); return FALSE; @@ -2002,7 +2002,7 @@ check_ip_params (TpSocketAddressType address_type, if (G_VALUE_TYPE (access_control_param) != TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4) { - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Port access param is supposed to be sq"); return FALSE; } @@ -2010,7 +2010,7 @@ check_ip_params (TpSocketAddressType address_type, return TRUE; } - g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%u socket access control is not supported", access_control); return FALSE; } @@ -2040,7 +2040,7 @@ gabble_tube_stream_check_params (TpSocketAddressType address_type, access_control_param, error); default: - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Address type %d not implemented", address_type); return FALSE; } @@ -2077,7 +2077,7 @@ send_tube_offer (GabbleTubeStream *self, if (presence == NULL) { DEBUG ("can't find tube recipient's presence"); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "can't find tube recipient's presence"); return FALSE; } @@ -2087,7 +2087,7 @@ send_tube_offer (GabbleTubeStream *self, if (resource == NULL) { DEBUG ("tube recipient doesn't have tubes capabilities"); - g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "tube recipient doesn't have tubes capabilities"); return FALSE; } @@ -2239,7 +2239,7 @@ gabble_tube_stream_offer_async (TpSvcChannelTypeStreamTube *iface, if (priv->state != TP_TUBE_CHANNEL_STATE_NOT_OFFERED) { - g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not in the not offered state"); dbus_g_method_return_error (context, error); g_error_free (error); diff --git a/src/tubes-channel.c b/src/tubes-channel.c index 7d7cab9..bc16463 100644 --- a/src/tubes-channel.c +++ b/src/tubes-channel.c @@ -1714,7 +1714,7 @@ gabble_tubes_channel_accept_d_bus_tube (TpSvcChannelTypeTubes *iface, tube = g_hash_table_lookup (priv->tubes, GUINT_TO_POINTER (id)); if (tube == NULL) { - GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; + GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; dbus_g_method_return_error (context, &e); return; @@ -1727,7 +1727,7 @@ gabble_tubes_channel_accept_d_bus_tube (TpSvcChannelTypeTubes *iface, if (type != TP_TUBE_TYPE_DBUS) { - GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not a D-Bus tube" }; dbus_g_method_return_error (context, &e); @@ -1736,7 +1736,7 @@ gabble_tubes_channel_accept_d_bus_tube (TpSvcChannelTypeTubes *iface, if (state != TP_TUBE_CHANNEL_STATE_LOCAL_PENDING) { - GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not in the local pending state" }; dbus_g_method_return_error (context, &e); @@ -1784,7 +1784,7 @@ gabble_tubes_channel_accept_stream_tube (TpSvcChannelTypeTubes *iface, tube = g_hash_table_lookup (priv->tubes, GUINT_TO_POINTER (id)); if (tube == NULL) { - GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; + GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; dbus_g_method_return_error (context, &e); return; @@ -1797,7 +1797,7 @@ gabble_tubes_channel_accept_stream_tube (TpSvcChannelTypeTubes *iface, if (type != TP_TUBE_TYPE_STREAM) { - GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not a stream tube" }; dbus_g_method_return_error (context, &e); @@ -1810,7 +1810,7 @@ gabble_tubes_channel_accept_stream_tube (TpSvcChannelTypeTubes *iface, address_type != TP_SOCKET_ADDRESS_TYPE_IPV4 && address_type != TP_SOCKET_ADDRESS_TYPE_IPV6) { - GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Address type not implemented" }; dbus_g_method_return_error (context, &e); @@ -1860,7 +1860,7 @@ gabble_tubes_channel_close_tube (TpSvcChannelTypeTubes *iface, if (tube == NULL) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; dbus_g_method_return_error (context, &error); return; @@ -1897,7 +1897,7 @@ gabble_tubes_channel_get_d_bus_tube_address (TpSvcChannelTypeTubes *iface, if (tube == NULL) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; dbus_g_method_return_error (context, &error); return; @@ -1910,7 +1910,7 @@ gabble_tubes_channel_get_d_bus_tube_address (TpSvcChannelTypeTubes *iface, if (type != TP_TUBE_TYPE_DBUS) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not a D-Bus tube" }; dbus_g_method_return_error (context, &error); @@ -1967,7 +1967,7 @@ gabble_tubes_channel_get_d_bus_names (TpSvcChannelTypeTubes *iface, if (tube == NULL) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; dbus_g_method_return_error (context, &error); return; @@ -1981,7 +1981,7 @@ gabble_tubes_channel_get_d_bus_names (TpSvcChannelTypeTubes *iface, if (type != TP_TUBE_TYPE_DBUS || priv->handle_type != TP_HANDLE_TYPE_ROOM) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not a Muc D-Bus tube" }; dbus_g_method_return_error (context, &error); @@ -1990,7 +1990,7 @@ gabble_tubes_channel_get_d_bus_names (TpSvcChannelTypeTubes *iface, if (state != TP_TUBE_CHANNEL_STATE_OPEN) { - GError error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Tube is not open" }; dbus_g_method_return_error (context, &error); @@ -2033,7 +2033,7 @@ gabble_tubes_channel_get_stream_tube_socket_address (TpSvcChannelTypeTubes *ifac tube = g_hash_table_lookup (priv->tubes, GUINT_TO_POINTER (id)); if (tube == NULL) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown tube" }; dbus_g_method_return_error (context, &error); return; @@ -2046,7 +2046,7 @@ gabble_tubes_channel_get_stream_tube_socket_address (TpSvcChannelTypeTubes *ifac if (type != TP_TUBE_TYPE_STREAM) { - GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, + GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not a Stream tube" }; dbus_g_method_return_error (context, &error); @@ -2055,7 +2055,7 @@ gabble_tubes_channel_get_stream_tube_socket_address (TpSvcChannelTypeTubes *ifac if (state != TP_TUBE_CHANNEL_STATE_OPEN) { - GError error = { TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Tube is not open" }; dbus_g_method_return_error (context, &error); diff --git a/src/util.c b/src/util.c index 4102f21..5607545 100644 --- a/src/util.c +++ b/src/util.c @@ -193,7 +193,7 @@ gabble_get_room_handle_from_jid (TpHandleRepoIface *room_repo, #define INVALID_HANDLE(e, f, ...) \ G_STMT_START { \ DEBUG (f, ##__VA_ARGS__); \ - g_set_error (e, TP_ERRORS, TP_ERROR_INVALID_HANDLE, f, ##__VA_ARGS__);\ + g_set_error (e, TP_ERROR, TP_ERROR_INVALID_HANDLE, f, ##__VA_ARGS__);\ } G_STMT_END gchar * diff --git a/src/vcard-manager.c b/src/vcard-manager.c index 67466be..54b5529 100644 --- a/src/vcard-manager.c +++ b/src/vcard-manager.c @@ -582,7 +582,7 @@ complete_one_request (GabbleVCardManagerRequest *request, static void disconnect_entry_foreach (gpointer handle, gpointer value, gpointer unused) { - GError err = { TP_ERRORS, TP_ERROR_DISCONNECTED, "Connection closed" }; + GError err = { TP_ERROR, TP_ERROR_DISCONNECTED, "Connection closed" }; GabbleVCardCacheEntry *entry = value; if (entry->suspended_timer_id) diff --git a/tests/tp-error-from-wocky.c b/tests/tp-error-from-wocky.c index 207ec59..729af31 100644 --- a/tests/tp-error-from-wocky.c +++ b/tests/tp-error-from-wocky.c @@ -19,7 +19,7 @@ test_remap (GQuark domain, &conn_reason, &error); g_assert (error != NULL); g_assert_cmpstr (g_quark_to_string (error->domain), ==, - g_quark_to_string (TP_ERRORS)); + g_quark_to_string (TP_ERROR)); g_assert_cmpint (error->code, ==, exp_code); g_assert_cmpint (conn_reason, ==, exp_reason); -- 1.7.10