diff --git a/packages/bolt-connection/src/channel/browser/browser-channel.js b/packages/bolt-connection/src/channel/browser/browser-channel.js index 4d7fed9e8..1e47b079f 100644 --- a/packages/bolt-connection/src/channel/browser/browser-channel.js +++ b/packages/bolt-connection/src/channel/browser/browser-channel.js @@ -151,7 +151,7 @@ export default class WebSocketChannel { this._handleConnectionError() } else { // Some other error occured - throw error + throw newError('unexpected failure to write.', undefined, error) } } } else { diff --git a/packages/bolt-connection/src/connection-provider/connection-provider-routing.js b/packages/bolt-connection/src/connection-provider/connection-provider-routing.js index 38243b868..7603d61da 100644 --- a/packages/bolt-connection/src/connection-provider/connection-provider-routing.js +++ b/packages/bolt-connection/src/connection-provider/connection-provider-routing.js @@ -813,7 +813,7 @@ function _isFailFastError (error) { } function _isFailFastSecurityError (error) { - return error.code.startsWith('Neo.ClientError.Security.') && + return error.code?.startsWith('Neo.ClientError.Security.') && ![ AUTHORIZATION_EXPIRED_CODE ].includes(error.code) diff --git a/packages/neo4j-driver-deno/lib/bolt-connection/channel/browser/browser-channel.js b/packages/neo4j-driver-deno/lib/bolt-connection/channel/browser/browser-channel.js index 1124d49a0..dd152ff6a 100644 --- a/packages/neo4j-driver-deno/lib/bolt-connection/channel/browser/browser-channel.js +++ b/packages/neo4j-driver-deno/lib/bolt-connection/channel/browser/browser-channel.js @@ -151,7 +151,7 @@ export default class WebSocketChannel { this._handleConnectionError() } else { // Some other error occured - throw error + throw newError('unexpected failure to write.', undefined, error) } } } else { diff --git a/packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-routing.js b/packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-routing.js index 46014726f..3740bf948 100644 --- a/packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-routing.js +++ b/packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-routing.js @@ -813,7 +813,7 @@ function _isFailFastError (error) { } function _isFailFastSecurityError (error) { - return error.code.startsWith('Neo.ClientError.Security.') && + return error.code?.startsWith('Neo.ClientError.Security.') && ![ AUTHORIZATION_EXPIRED_CODE ].includes(error.code)