Skip to content

Commit 31b8000

Browse files
committed
Connection errors should be thrown with the root cause
1 parent 9c30c13 commit 31b8000

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

bolt-connection/src/bolt/bolt-protocol-v1.js

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export default class BoltProtocol {
8484
return BOLT_PROTOCOL_V1
8585
}
8686

87+
get currentFailure () {
88+
return this._responseHandler.currentFailure
89+
}
90+
8791
/**
8892
* Get the packer.
8993
* @return {Packer} the protocol's packer.

bolt-connection/src/bolt/response-handler.js

+4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ export default class ResponseHandler {
146146
}
147147
}
148148

149+
get currentFailure () {
150+
return this._currentFailure
151+
}
152+
149153
/*
150154
* Pop next pending observer form the list of observers and make it current observer.
151155
* @protected

bolt-connection/src/connection/connection-channel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export default class ChannelConnection extends Connection {
270270
*/
271271
_handleFatalError (error) {
272272
this._isBroken = true
273-
this._error = this.handleAndTransformError(error, this._address)
273+
this._error = this.handleAndTransformError(this._protocol.currentFailure || error, this._address)
274274

275275
if (this._log.isErrorEnabled()) {
276276
this._log.error(

0 commit comments

Comments
 (0)