[telepathy-mission-control/master] Use TP errors whenever possible
Alberto Mardegan
alberto.mardegan at nokia.com
Fri Apr 3 02:08:32 PDT 2009
---
src/mcd-connection.c | 25 ++++++-------------------
1 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index 4a8a8c7..2410ffc 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -1991,8 +1991,8 @@ mcd_connection_get_telepathy_details (McdConnection * id,
static GError *
map_tp_error_to_mc_error (McdChannel *channel, const GError *error)
{
- MCError mc_error_code = MC_CHANNEL_REQUEST_GENERIC_ERROR;
-
+ McError mc_error_code;
+
g_warning ("Telepathy Error = %s", error->message);
/* TODO : Are there still more specific errors we need
@@ -2004,24 +2004,11 @@ map_tp_error_to_mc_error (McdChannel *channel, const GError *error)
{
mc_error_code = MC_CONTACT_DOES_NOT_SUPPORT_VOICE_ERROR;
}
- else if (error->code == TP_ERROR_CHANNEL_BANNED)
- {
- mc_error_code = MC_CHANNEL_BANNED_ERROR;
- }
- else if (error->code == TP_ERROR_CHANNEL_FULL)
- {
- mc_error_code = MC_CHANNEL_FULL_ERROR;
- }
- else if (error->code == TP_ERROR_CHANNEL_INVITE_ONLY)
- {
- mc_error_code = MC_CHANNEL_INVITE_ONLY_ERROR;
- }
- else if (error->code == TP_ERROR_INVALID_HANDLE)
- {
- mc_error_code = MC_INVALID_HANDLE_ERROR;
- }
+ else
+ return g_error_copy (error);
+
return g_error_new (MC_ERROR, mc_error_code, "Telepathy Error: %s",
- error->message);
+ error->message);
}
static void
--
1.5.6.5
More information about the telepathy-commits
mailing list