From 0695bafb901be612fb0270920d6cef5b0ff37fed Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Sun, 17 Feb 2019 19:39:11 +0100 Subject: [PATCH] fix(xen-api#_transportCall): pTimeout.call Fixes 8e116063b --- packages/xen-api/src/index.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/xen-api/src/index.js b/packages/xen-api/src/index.js index 1d94242c4..551f8f537 100644 --- a/packages/xen-api/src/index.js +++ b/packages/xen-api/src/index.js @@ -1134,17 +1134,19 @@ export class Xapi extends EventEmitter { Xapi.prototype._transportCall = reduce( [ function(method, args) { - return pTimeout(this._call(method, args), HTTP_TIMEOUT).catch(error => { - if (!(error instanceof Error)) { - error = wrapError(error) - } + return pTimeout + .call(this._call(method, args), HTTP_TIMEOUT) + .catch(error => { + if (!(error instanceof Error)) { + error = wrapError(error) + } - error.call = { - method, - params: replaceSensitiveValues(args, '* obfuscated *'), - } - throw error - }) + error.call = { + method, + params: replaceSensitiveValues(args, '* obfuscated *'), + } + throw error + }) }, call => function() {