@celerispay/hazelcast-client 3.12.5-3 → 3.12.5-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -135,9 +135,9 @@ var ClientConnectionManager = /** @class */ (function (_super) {
|
|
|
135
135
|
}).catch(function (error) {
|
|
136
136
|
if (retryCount < _this.maxConnectionRetries) {
|
|
137
137
|
_this.logger.warn('ClientConnectionManager', "Connection attempt " + (retryCount + 1) + " failed for " + address.toString() + ", retrying in " + _this.connectionRetryDelay + "ms");
|
|
138
|
-
return new Promise(function (resolve) {
|
|
138
|
+
return new Promise(function (resolve, reject) {
|
|
139
139
|
setTimeout(function () {
|
|
140
|
-
_this.retryConnection(address, asOwner, retryCount + 1).then(resolve).catch(
|
|
140
|
+
_this.retryConnection(address, asOwner, retryCount + 1).then(resolve).catch(reject);
|
|
141
141
|
}, _this.connectionRetryDelay);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
@@ -273,6 +273,13 @@ var ClientConnectionManager = /** @class */ (function (_super) {
|
|
|
273
273
|
this.pendingConnections[addressIndex] = connectionResolver;
|
|
274
274
|
this.retryConnection(address, asOwner)
|
|
275
275
|
.then(function (clientConnection) {
|
|
276
|
+
// Safety check: ensure we got a proper ClientConnection
|
|
277
|
+
if (!clientConnection || typeof clientConnection.getAddress !== 'function') {
|
|
278
|
+
var error = new Error("Invalid connection object returned: " + typeof clientConnection);
|
|
279
|
+
_this.logger.error('ClientConnectionManager', error.message);
|
|
280
|
+
connectionResolver.reject(error);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
276
283
|
_this.establishedConnections[clientConnection.getAddress().toString()] = clientConnection;
|
|
277
284
|
_this.onConnectionOpened(clientConnection);
|
|
278
285
|
connectionResolver.resolve(clientConnection);
|
package/package.json
CHANGED