From e1da08ba382c4e6f258b9385c4cd39d2f7fab62a Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Thu, 28 Mar 2019 18:19:18 +0100 Subject: [PATCH] chore(xen-api/connect): assert initially disconnected --- packages/xen-api/src/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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