fix(xo-cli): close connection on sign in error
Otherwise the CLI does not stop.
This commit is contained in:
parent
3d6defca37
commit
c14261a0bc
@ -29,6 +29,7 @@
|
||||
|
||||
<!--packages-start-->
|
||||
|
||||
- xo-cli patch
|
||||
- xo-server patch
|
||||
|
||||
<!--packages-end-->
|
||||
|
@ -44,7 +44,12 @@ async function connect() {
|
||||
|
||||
const xo = new Xo({ rejectUnauthorized: !allowUnauthorized, url: server })
|
||||
await xo.open()
|
||||
await xo.signIn({ token })
|
||||
try {
|
||||
await xo.signIn({ token })
|
||||
} catch (error) {
|
||||
await xo.close()
|
||||
throw error
|
||||
}
|
||||
return xo
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user