fix(xen-api): getObject* throw nosuchObject

This commit is contained in:
mathieuRA
2025-06-04 10:42:55 +02:00
committed by Florent BEAUCHAMP
parent 83f52c25cb
commit d47fa03ec8
3 changed files with 7 additions and 4 deletions

View File

@@ -42,6 +42,7 @@
- @xen-orchestra/rest-api patch
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor
- xen-api patch
- xo-server minor
- xo-server-perf-alert patch
- xo-web patch

View File

@@ -25,6 +25,7 @@ import makeCallSetting from './_makeCallSetting.mjs'
import parseUrl from './_parseUrl.mjs'
import Ref from './_Ref.mjs'
import transports from './transports/index.mjs'
import { noSuchObject } from 'xo-common/api-errors.js'
const { debug } = createLogger('xen-api')
@@ -722,7 +723,7 @@ export class Xapi extends EventEmitter {
if (arguments.length > 1) return defaultValue
throw new Error('no object with UUID or opaque ref: ' + idOrUuidOrRef)
/* throw */ noSuchObject(idOrUuidOrRef)
}
// Returns the object for a given opaque reference (internal to
@@ -734,7 +735,7 @@ export class Xapi extends EventEmitter {
if (arguments.length > 1) return defaultValue
throw new Error('no object with opaque ref: ' + ref)
/* throw */ noSuchObject(ref)
}
// Returns the object for a given UUID (unique identifier that some
@@ -747,7 +748,7 @@ export class Xapi extends EventEmitter {
if (arguments.length > 1) return defaultValue
throw new Error('no object with UUID: ' + uuid)
/* throw */ noSuchObject(uuid)
}
// manually run events watching if set to `false` in constructor

View File

@@ -53,7 +53,8 @@
"promise-toolbox": "^0.21.0",
"pw": "0.0.4",
"undici": "^6.2.1",
"xo-collection": "^0.5.0"
"xo-collection": "^0.5.0",
"xo-common": "^0.8.0"
},
"devDependencies": {
"getopts": "^2.3.0",