about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
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);