catch exceptions from req.cancel() (#1359)

* catch exceptions from req.cancel()

* catch other instances of req.cancel

* fix prev commit
This commit is contained in:
Dave Horton
2025-09-11 12:25:36 -04:00
committed by GitHub
parent 057f52e56c
commit 65b3066866
3 changed files with 28 additions and 7 deletions

View File

@@ -329,7 +329,13 @@ class SingleDialer extends Emitter {
*/
async kill(Reason) {
this.killed = true;
if (this.inviteInProgress) await this.inviteInProgress.cancel();
if (this.inviteInProgress) {
try {
await this.inviteInProgress.cancel();
} catch (err) {
this.logger.error({err}, 'SingleDialer:kill error cancelling invite');
}
}
else if (this.dlg && this.dlg.connected) {
const duration = moment().diff(this.dlg.connectTime, 'seconds');
this.logger.debug('SingleDialer:kill hanging up called party');