Skip to content

Commit d9c326c

Browse files
committed
Fix connection message to only show on specific error when running cypher queries' is not a valid branch name
1 parent 11dbedd commit d9c326c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/scripts/services/CypherTransactionBolt.coffee

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,12 @@ angular.module('neo4jApp.services')
107107
r.responseTime = timer.stop().time()
108108
q.resolve({original: r, remapped: Bolt.constructResult(r)})
109109
that._reset()
110-
).catch((r) ->
111-
$rootScope.bolt_connection_failure = yes
110+
).catch((r) ->
111+
errObj = Bolt.constructResult(r)
112+
if errObj.data.errors[0].code is 'Socket.Error' || errObj.data.errors[0].message.indexOf('WebSocket connection failure') == 0
113+
$rootScope.bolt_connection_failure = yes
112114
r.responseTime = timer.stop().time()
113-
q.reject({original: r, remapped: Bolt.constructResult(r)})
115+
q.reject({original: r, remapped: errObj})
114116
that._reset()
115117
)
116118
res = promiseResult(q.promise)

0 commit comments

Comments
 (0)