diff --git a/packages/xen-api/src/index.js b/packages/xen-api/src/index.js index c1cc7ead8..9f030e8d3 100644 --- a/packages/xen-api/src/index.js +++ b/packages/xen-api/src/index.js @@ -1,3 +1,4 @@ +import assert from 'assert' import Collection from 'xo-collection' import kindOf from 'kindof' import ms from 'ms' @@ -210,9 +211,7 @@ export class Xapi extends EventEmitter { return } - if (status === CONNECTING) { - throw new Error('already connecting') - } + assert(status === DISCONNECTED) const auth = this._auth