@@ -885,6 +885,11 @@ const api = _converse.api = {
let promise;
if (reject) {
promise = new Promise((resolve, reject) => _converse.connection.sendIQ(stanza, resolve, reject, timeout));
+ promise.catch(e => {
+ if (e === null) {
+ throw new TimeoutError(`Timeout error after ${timeout}ms for the following IQ stanza: ${stanza}`);
+ }
+ });
} else {
promise = new Promise(resolve => _converse.connection.sendIQ(stanza, resolve, resolve, timeout));
}
@@ -147,7 +147,7 @@ converse.plugins.add('converse-disco', {
try {
stanza = await api.disco.info(this.get('jid'), null);
} catch (iq) {
- log.error(iq);
+ iq === null ? log.error(`Timeout for disco#info query for ${this.get('jid')}`) : log.error(iq);
this.waitUntilFeaturesDiscovered.resolve(this);
return;