Skip to content

Commit 69f0a7b

Browse files
4.0 enhanche error message for connection failure (#353)
* Fixed comment about BoltConnectionError hiearchy * Enhance error message for connection failure
1 parent fdd0701 commit 69f0a7b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

neo4j/_exceptions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ class BoltConnectionError(BoltError):
4040
"""
4141

4242
def __init__(self, message, address):
43-
super().__init__(message, address)
43+
msg = (
44+
"Connection Failed. "
45+
"Please ensure that your database is listening on the correct host and port and that you have enabled encryption if required. "
46+
"Note that the default encryption setting has changed in Neo4j 4.0. See the docs for more information. "
47+
"{}")
48+
49+
super().__init__(msg.format(message), address)
4450

4551
def __str__(self):
4652
s = super().__str__()

neo4j/exceptions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@
5555
+ BoltHandshakeError
5656
+ BoltRoutingError
5757
+ BoltConnectionError
58+
+ BoltSecurityError
59+
+ BoltConnectionBroken
60+
+ BoltConnectionClosed
5861
+ BoltFailure
59-
+ BoltSecurityError
6062
+ BoltIncompleteCommitError
6163
+ BoltProtocolError
6264
+ Bolt*

0 commit comments

Comments
 (0)