Skip to content

Commit

Permalink
Improve an error message
Browse files Browse the repository at this point in the history
Be more informative in the error message which the client reports when it
doesn't get back the expected handshake value from the server.
  • Loading branch information
iamsrp-deshaw committed Nov 3, 2023
1 parent f7e051a commit 5d012c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/pjrmi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,13 @@ def connect(self):
# the server, and that should be pretty obvious from context.
if ack != self._HELLO:
self._transport.disconnect()
raise IOError("Didn't get expected hand-shake back: %s" % ack)
raise IOError(
"Didn't get expected handshake back; "
"got %s but expected %s; "
"this likely indicates a version mismatch between "
"the client and server libraries."
% (ack, self._HELLO)
)

# We are about to get a short string back. Read in its size, if it's
# negative then it means we encountered an error and the connection will
Expand Down

0 comments on commit 5d012c9

Please sign in to comment.