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