Open Source Telephony
 help / color / mirror / Atom feed
From: Philippe Nunes <philippe.nunes@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 5/6] Return specific ofono errors according telephony errors
Date: Tue, 29 May 2012 18:38:36 +0200	[thread overview]
Message-ID: <1338309517-14808-6-git-send-email-philippe.nunes@linux.intel.com> (raw)
In-Reply-To: <1338309517-14808-1-git-send-email-philippe.nunes@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 4211 bytes --]

---
 src/call-barring.c    |   11 +++++++----
 src/call-forwarding.c |    6 ++++--
 src/call-settings.c   |   18 ++++++++++--------
 3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/src/call-barring.c b/src/call-barring.c
index ddf4c73..c983d90 100644
--- a/src/call-barring.c
+++ b/src/call-barring.c
@@ -35,6 +35,7 @@
 #include "ofono.h"
 
 #include "common.h"
+#include "error-mapping.h"
 
 #define CALL_BARRING_FLAG_CACHED 0x1
 #define NUM_OF_BARRINGS 5
@@ -323,9 +324,10 @@ static void cb_ss_set_lock_callback(const struct ofono_error *error,
 	struct ofono_call_barring *cb = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Enabling/disabling Call Barring via SS failed");
+		DBG("Enabling/disabling Call Barring via SS failed with err:%s",
+			telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cb->pending,
-					__ofono_error_failed(cb->pending));
+			telephony_error_to_ofono_err(error, cb->pending));
 		return;
 	}
 
@@ -485,8 +487,9 @@ static void cb_set_passwd_callback(const struct ofono_error *error, void *data)
 	if (error->type == OFONO_ERROR_TYPE_NO_ERROR)
 		reply = dbus_message_new_method_return(cb->pending);
 	else {
-		reply = __ofono_error_failed(cb->pending);
-		DBG("Changing Call Barring password via SS failed");
+		DBG("Changing Call Barring password via SS failed with err: %s",
+				telephony_error_to_str(error));
+		reply = telephony_error_to_ofono_err(error, cb->pending);
 	}
 
 	__ofono_dbus_pending_reply(&cb->pending, reply);
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 3d9c5c1..7525479 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -35,6 +35,7 @@
 
 #include "common.h"
 #include "simutil.h"
+#include "error-mapping.h"
 
 #define CALL_FORWARDING_FLAG_CACHED	0x1
 #define CALL_FORWARDING_FLAG_CPHS_CFF	0x2
@@ -1020,10 +1021,11 @@ static void cf_ss_control_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_forwarding *cf = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during cf ss control set/erasure");
 
+		DBG("CF ss control set/erasure failed with error: %s",
+						telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cf->pending,
-					__ofono_error_failed(cf->pending));
+		telephony_error_to_ofono_err(error, cf->pending));
 		g_free(cf->ss_req);
 		cf->ss_req = NULL;
 		return;
diff --git a/src/call-settings.c b/src/call-settings.c
index 6bc9658..e13e3de 100644
--- a/src/call-settings.c
+++ b/src/call-settings.c
@@ -34,6 +34,7 @@
 #include "ofono.h"
 
 #include "common.h"
+#include "error-mapping.h"
 
 #define CALL_SETTINGS_FLAG_CACHED 0x1
 
@@ -477,9 +478,10 @@ static void cw_ss_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting CW via SS failed");
+		DBG("setting CW via SS failed with error: %s",
+			telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cs->pending,
-					__ofono_error_failed(cs->pending));
+			telephony_error_to_ofono_err(error, cs->pending));
 
 		return;
 	}
@@ -614,10 +616,10 @@ static void clip_cnap_colp_colr_ss_query_cb(const struct ofono_error *error,
 	const char *value;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("Error occurred during ss control query");
+		DBG("SS control query failed with error: %s",
+			telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cs->pending,
-					__ofono_error_failed(cs->pending));
-
+			telephony_error_to_ofono_err(error, cs->pending));
 		return;
 	}
 
@@ -772,10 +774,10 @@ static void clir_ss_set_callback(const struct ofono_error *error, void *data)
 	struct ofono_call_settings *cs = data;
 
 	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
-		DBG("setting clir via SS failed");
+		DBG("setting clir via SS failed with error: %s",
+			telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&cs->pending,
-					__ofono_error_failed(cs->pending));
-
+			telephony_error_to_ofono_err(error, cs->pending));
 		return;
 	}
 
-- 
1.7.9.5


  parent reply	other threads:[~2012-05-29 16:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29 16:38 [PATCH 0/6] Return specific ofono errors after SS transaction Philippe Nunes
2012-05-29 16:38 ` [PATCH 1/6] common: Fix typos in error strings Philippe Nunes
2012-05-30  5:22   ` Denis Kenzior
2012-05-29 16:38 ` [PATCH 2/6] dbus: Add new error types Philippe Nunes
2012-05-30  5:23   ` Denis Kenzior
2012-05-29 16:38 ` [PATCH 3/6] error-mapping: Add function to map telephony errors into ofono " Philippe Nunes
2012-05-30  5:42   ` Denis Kenzior
2012-05-29 16:38 ` [PATCH 4/6] build: Add error-mapping utility to build Philippe Nunes
2012-05-29 16:38 ` Philippe Nunes [this message]
2012-05-29 16:38 ` [PATCH 6/6] Extend the list of ofono error types returned by the method initiate Philippe Nunes
2012-05-30  5:45   ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338309517-14808-6-git-send-email-philippe.nunes@linux.intel.com \
    --to=philippe.nunes@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox