about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-09-09 22:32:52 +0100
committerJames Booth <boothj5@gmail.com>2014-09-09 22:32:52 +0100
commitaa7fe0991f604a8ccee56ef8665645b1a6399d30 (patch)
treed41ff4e64bd126b6f2345fb9c3484210fa4d09fd /src
parent3417f25dd1116ed2f3950bc8df85d736ad0223d8 (diff)
downloadprofani-tty-aa7fe0991f604a8ccee56ef8665645b1a6399d30.tar.gz
Added usages for stanza_get_error_message in iq.c
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/iq.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index 8fcd8b7b..2224173e 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -208,15 +208,18 @@ _error_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
     void * const userdata)
 {
     const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
+    char *error_msg = stanza_get_error_message(stanza);
 
     if (id != NULL) {
-        log_debug("IQ error handler fired, id: %s.", id);
-        log_error("IQ error received, id: %s.", id);
+        log_debug("IQ error handler fired, id: %s, error: %s", id, error_msg);
+        log_error("IQ error received, id: %s, error: %s", id, error_msg);
     } else {
-        log_debug("IQ error handler fired.");
-        log_error("IQ error received.");
+        log_debug("IQ error handler fired, error: %s", error_msg);
+        log_error("IQ error received, error: %s", error_msg);
     }
 
+    free(error_msg);
+
     return 1;
 }
 
@@ -236,7 +239,9 @@ _pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
     if (id != NULL && type != NULL) {
         // show warning if error
         if (strcmp(type, STANZA_TYPE_ERROR) == 0) {
-            log_warning("Server ping (id=%s) responded with error", id);
+            char *error_msg = stanza_get_error_message(stanza);
+            log_warning("Server ping (id=%s) responded with error: %s", id, error_msg);
+            free(error_msg);
 
             // turn off autoping if error type is 'cancel'
             xmpp_stanza_t *error = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_ERROR);