From 3279728e4b4c79d68149ce985837ceb12f945a24 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Fri, 1 Mar 2019 13:41:50 +0100 Subject: [PATCH] chore(xen-api/events): prints errors --- packages/xen-api/src/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/xen-api/src/index.js b/packages/xen-api/src/index.js index f0e87b44d..20100dabd 100644 --- a/packages/xen-api/src/index.js +++ b/packages/xen-api/src/index.js @@ -956,7 +956,11 @@ export class Xapi extends EventEmitter { async _watchEventsWrapper() { if (!this._watching) { this._watching = true - await ignoreErrors.call(this._watchEvents()) + try { + await this._watchEvents() + } catch (error) { + console.error('_watchEventsWrapper', error) + } this._watching = false } } @@ -997,9 +1001,12 @@ export class Xapi extends EventEmitter { this._addObject(type, ref, record) } ) - } catch (_) { + } catch (error) { // there is nothing ideal to do here, do not interrupt event // handling + if (error != null && error.code !== 'MESSAGE_REMOVED') { + console.warn('_watchEvents', 'initial fetch', type, error) + } } }) )