summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Friloux <guillaume.friloux@gmail.com>2014-01-07 10:44:00 +0100
committerGuillaume Friloux <guillaume.friloux@gmail.com>2014-01-07 10:44:00 +0100
commitfeedcc4919feb92fb81f087b1c1b92fa958179eb (patch)
treeca07125fbc1251662320b2843b44e3914be06dda
parenta1d9a09bf6811cba54c307b79b47c7649f1a7410 (diff)
Make libstore to be more verbose on errors.
-rw-r--r--src/lib/store/store_event.c7
-rw-r--r--src/lib/store/store_main.c1
-rw-r--r--src/lib/store/store_private.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/store/store_event.c b/src/lib/store/store_event.c
index c46a296..2c60261 100644
--- a/src/lib/store/store_event.c
+++ b/src/lib/store/store_event.c
@@ -63,7 +63,12 @@ store_event_complete(void *data,
63 http_code = ecore_con_url_status_code_get(sa->ec); 63 http_code = ecore_con_url_status_code_get(sa->ec);
64 if ((http_code != 200) && (http_code != 201)) 64 if ((http_code != 200) && (http_code != 201))
65 { 65 {
66 errstr = store_utils_dupf("Server replied HTTP code %i", http_code); 66 errstr = store_utils_dupf("Server replied HTTP code %i\n"
67 "Data sent :\n%s\n"
68 "Server replied :\n%s",
69 http_code,
70 sa->data.sent,
71 eina_strbuf_string_get(sa->data.buf));
67 sa->cb.error((void *)sa->cb.data, sa->store, errstr); 72 sa->cb.error((void *)sa->cb.data, sa->store, errstr);
68 free(errstr); 73 free(errstr);
69 return EINA_TRUE; 74 return EINA_TRUE;
diff --git a/src/lib/store/store_main.c b/src/lib/store/store_main.c
index bcb4b81..f1c964f 100644
--- a/src/lib/store/store_main.c
+++ b/src/lib/store/store_main.c
@@ -92,6 +92,7 @@ store_add(Store *store,
92 sa->cb.done = done_cb; 92 sa->cb.done = done_cb;
93 sa->cb.error = error_cb; 93 sa->cb.error = error_cb;
94 sa->cb.data = data; 94 sa->cb.data = data;
95 sa->data.sent = strdup(buf);
95 DBG("store[%p] sa[%p] buf[%s]", store, sa, buf); 96 DBG("store[%p] sa[%p] buf[%s]", store, sa, buf);
96 ecore_con_url_data_set(sa->ec, sa); 97 ecore_con_url_data_set(sa->ec, sa);
97 r = ecore_con_url_post(sa->ec, buf, len, "text/json"); 98 r = ecore_con_url_post(sa->ec, buf, len, "text/json");
diff --git a/src/lib/store/store_private.h b/src/lib/store/store_private.h
index 6112293..f743911 100644
--- a/src/lib/store/store_private.h
+++ b/src/lib/store/store_private.h
@@ -38,6 +38,7 @@ typedef struct _Store_Add
38 struct 38 struct
39 { 39 {
40 Eina_Strbuf *buf; /*!< Buffer for data reception */ 40 Eina_Strbuf *buf; /*!< Buffer for data reception */
41 char *sent; /*!< Data to store */
41 } data; 42 } data;
42 43
43 struct 44 struct