feat(xo-cli rest): explicit error if not registered
Fixes https://xcp-ng.org/forum/post/68698
This commit is contained in:
parent
2ec164c560
commit
0d4cf48410
@ -35,6 +35,7 @@
|
||||
<!--packages-start-->
|
||||
|
||||
- vhd-lib patch
|
||||
- xo-cli minor
|
||||
- xo-server minor
|
||||
- xo-web minor
|
||||
|
||||
|
@ -134,6 +134,12 @@ export async function rest(args) {
|
||||
|
||||
const { allowUnauthorized, server, token } = await config.load()
|
||||
|
||||
if (server === undefined) {
|
||||
const errorMessage =
|
||||
'Please use `xo-cli --register` to associate with an XO instance first.\n\nSee `xo-cli --help` for more info.'
|
||||
throw errorMessage
|
||||
}
|
||||
|
||||
const baseUrl = server
|
||||
const baseOpts = {
|
||||
headers: {
|
||||
|
Loading…
Reference in New Issue
Block a user