Make sure IQ timeouts are properly logged
This commit is contained in:
parent
4425c3dde7
commit
35de251ce7
@ -885,6 +885,11 @@ const api = _converse.api = {
|
|||||||
let promise;
|
let promise;
|
||||||
if (reject) {
|
if (reject) {
|
||||||
promise = new Promise((resolve, reject) => _converse.connection.sendIQ(stanza, resolve, reject, timeout));
|
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 {
|
} else {
|
||||||
promise = new Promise(resolve => _converse.connection.sendIQ(stanza, resolve, resolve, timeout));
|
promise = new Promise(resolve => _converse.connection.sendIQ(stanza, resolve, resolve, timeout));
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ converse.plugins.add('converse-disco', {
|
|||||||
try {
|
try {
|
||||||
stanza = await api.disco.info(this.get('jid'), null);
|
stanza = await api.disco.info(this.get('jid'), null);
|
||||||
} catch (iq) {
|
} 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);
|
this.waitUntilFeaturesDiscovered.resolve(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user