Prevent exiting when an exception is uncaught

This commit is contained in:
Asher
2020-03-30 15:52:11 -05:00
parent 599670136d
commit 6c104c016e
2 changed files with 16 additions and 9 deletions

View File

@@ -24,11 +24,11 @@ export class SshProvider extends HttpProvider {
})
}
public async listen(): Promise<string> {
public async listen(): Promise<number> {
return new Promise((resolve, reject) => {
this.sshServer.once("error", reject)
this.sshServer.listen(() => {
resolve(this.sshServer.address().port.toString())
resolve(this.sshServer.address().port)
})
})
}