chore(xen-api/events): prints errors

This commit is contained in:
Julien Fontanet 2019-03-01 13:41:50 +01:00
parent fe0dcbacc5
commit 3279728e4b

View File

@ -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)
}
}
})
)