fix(xen-api#_transportCall): pTimeout.call

Fixes 8e116063b
This commit is contained in:
Julien Fontanet
2019-02-17 19:39:11 +01:00
parent 8e116063bf
commit 0695bafb90

View File

@@ -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() {