generated from ali/HarmonyTemplate
T6 review: suppress orphaned open() timer rejection when sendPacket fails first
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user