Skip to content

Commit b6f9b39

Browse files
author
Peter Wilhelmsson
committed
Sanitize authority token to improve connection error message
Error message received from neo4j server looks a bit better when scheme is explicitly set to 'none' instead of being undefined.
1 parent ad0317a commit b6f9b39

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ function driver (url, authToken, config = {}) {
228228
config.trust = trust
229229
}
230230

231+
// Sanitize authority token. Nicer error from server when a scheme is set.
232+
authToken = authToken || {}
233+
authToken.scheme = authToken.scheme || 'none'
234+
231235
if (routing) {
232236
return new RoutingDriver(
233237
ServerAddress.fromUrl(parsedUrl.hostAndPort),

0 commit comments

Comments
 (0)