Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setTimeout(function () {
if (othis.responseCallbacks[id]) {
othis.responseCallbacks[id](errors.ConnectionTimeout(othis.customTimeout));
delete othis.responseCallbacks[id];
}
}, this.customTimeout);
}
request.ontimeout = function () {
othis.connected = false;
callback(errors.ConnectionTimeout(_this.timeout));
};
try {
request.ontimeout = () => {
othis.connected = false;
callback(errors.ConnectionTimeout(this.timeout));
};
setTimeout( () => {
if (othis.responseCallbacks[id]) {
othis.responseCallbacks[id](errors.ConnectionTimeout(othis.customTimeout));
delete othis.responseCallbacks[id];
}
}, this.customTimeout);
}
setTimeout(function () {
if (othis.responseCallbacks[id]) {
othis.responseCallbacks[id](errors.ConnectionTimeout(othis.customTimeout));
delete othis.responseCallbacks[id];
}
}, this.customTimeout);
}
setTimeout( () => {
if (othis.responseCallbacks[id]) {
othis.responseCallbacks[id](errors.ConnectionTimeout(othis.customTimeout));
delete othis.responseCallbacks[id];
}
}, this.customTimeout);
}
setTimeout(function () {
if (_this.responseCallbacks[id]) {
_this.responseCallbacks[id](errors.ConnectionTimeout(_this._customTimeout));
delete _this.responseCallbacks[id];
}
}, this._customTimeout);
}
request.ontimeout = function() {
_this.connected = false;
callback(errors.ConnectionTimeout(this.timeout));
};
setTimeout(function () {
if (_this.responseCallbacks[id]) {
_this.responseCallbacks[id](errors.ConnectionTimeout(_this._customTimeout));
delete _this.responseCallbacks[id];
}
}, this._customTimeout);
}
request.ontimeout = () => {
othis.connected = false;
callback(errors.ConnectionTimeout(this.timeout));
};