neo4j-driver 4.3.4 → 4.3.5

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.
@@ -129,6 +129,13 @@ var BoltProtocol = /** @class */ (function () {
129
129
  enumerable: false,
130
130
  configurable: true
131
131
  });
132
+ Object.defineProperty(BoltProtocol.prototype, "currentFailure", {
133
+ get: function () {
134
+ return this._responseHandler.currentFailure;
135
+ },
136
+ enumerable: false,
137
+ configurable: true
138
+ });
132
139
  /**
133
140
  * Get the packer.
134
141
  * @return {Packer} the protocol's packer.
@@ -1693,6 +1700,13 @@ var ResponseHandler = /** @class */ (function () {
1693
1700
  this._observer.onError(neo4j_driver_core_1.newError('Unknown Bolt protocol message: ' + msg));
1694
1701
  }
1695
1702
  };
1703
+ Object.defineProperty(ResponseHandler.prototype, "currentFailure", {
1704
+ get: function () {
1705
+ return this._currentFailure;
1706
+ },
1707
+ enumerable: false,
1708
+ configurable: true
1709
+ });
1696
1710
  /*
1697
1711
  * Pop next pending observer form the list of observers and make it current observer.
1698
1712
  * @protected
@@ -4771,7 +4785,8 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
4771
4785
  };
4772
4786
  RoutingConnectionProvider.prototype._createSessionForRediscovery = function (routerAddress, bookmark) {
4773
4787
  return __awaiter(this, void 0, void 0, function () {
4774
- var connection, connectionProvider, protocolVersion, error_4;
4788
+ var connection, databaseSpecificErrorHandler, connectionProvider, protocolVersion, error_4;
4789
+ var _this = this;
4775
4790
  return __generator(this, function (_a) {
4776
4791
  switch (_a.label) {
4777
4792
  case 0:
@@ -4779,7 +4794,11 @@ var RoutingConnectionProvider = /** @class */ (function (_super) {
4779
4794
  return [4 /*yield*/, this._connectionPool.acquire(routerAddress)];
4780
4795
  case 1:
4781
4796
  connection = _a.sent();
4782
- connectionProvider = new connection_provider_single_1.default(connection);
4797
+ databaseSpecificErrorHandler = connection_1.ConnectionErrorHandler.create({
4798
+ errorCode: SESSION_EXPIRED,
4799
+ handleAuthorizationExpired: function (error, address) { return _this._handleAuthorizationExpired(error, address); }
4800
+ });
4801
+ connectionProvider = new connection_provider_single_1.default(new connection_1.DelegateConnection(connection, databaseSpecificErrorHandler));
4783
4802
  protocolVersion = connection.protocol().version;
4784
4803
  if (protocolVersion < 4.0) {
4785
4804
  return [2 /*return*/, new neo4j_driver_core_1.Session({
@@ -5363,7 +5382,7 @@ var ChannelConnection = /** @class */ (function (_super) {
5363
5382
  */
5364
5383
  ChannelConnection.prototype._handleFatalError = function (error) {
5365
5384
  this._isBroken = true;
5366
- this._error = this.handleAndTransformError(error, this._address);
5385
+ this._error = this.handleAndTransformError(this._protocol.currentFailure || error, this._address);
5367
5386
  if (this._log.isErrorEnabled()) {
5368
5387
  this._log.error("experienced a fatal error " + neo4j_driver_core_1.json.stringify(this._error));
5369
5388
  }
@@ -27803,7 +27822,7 @@ exports["default"] = void 0;
27803
27822
  // This is set up this way to keep the version in the code in
27804
27823
  // sync with the npm package version, and to allow the build
27805
27824
  // system to control version names at packaging time.
27806
- var _default = '4.3.4';
27825
+ var _default = '4.3.5';
27807
27826
  exports["default"] = _default;
27808
27827
 
27809
27828
  },{}]},{},[296])(296)