Better error messages in XO#getXAPI().

This commit is contained in:
Julien Fontanet
2015-04-14 11:40:46 +02:00
parent 0eec1c1f61
commit ed0ab78048

View File

@@ -335,9 +335,13 @@ class $XO extends $EventEmitter
{$poolId: poolId} = object
unless poolId
throw new Error "no XAPI found for #{object.id}"
throw new Error "object #{object.id} does not belong to a pool"
return @_xapis[poolId]
xapi = @_xapis[poolId]
unless xapi
throw new Error "no connection found for object #{object.id}"
return xapi
#-------------------------------------------------------------------