T6 review: suppress orphaned open() timer rejection when sendPacket fails first

This commit is contained in:
STRIX
2026-09-08 14:48:17 +08:00
parent 9346cbb646
commit edb66effd9
+6
View File
@@ -84,6 +84,12 @@ export class SshChannel {
}
}, timeoutMs);
});
// If sendPacket below throws first, the timer above would later reject
// a promise nobody awaits; mark it handled (await below still throws).
opened.catch((e: Object): void => {
const err = e as Error;
Log.debug(SshChannel.TAG, `open wait aborted: ${err.message}`);
});
await this.transport.sendPacket(w.toBytes());
await opened;
}