mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-09-11 06:29:51 -05:00
fix(xen-api): getObject* throw nosuchObject
This commit is contained in:
committed by
Florent BEAUCHAMP
parent
83f52c25cb
commit
d47fa03ec8
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user