Skip to content

Commit 386ecc3

Browse files
committed
return message as part of exception
1 parent 4768f5a commit 386ecc3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

py/selenium/webdriver/remote/websocket_connection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ def execute(self, command):
6464
self._wait_until(lambda: current_id in self._messages)
6565
response = self._messages.pop(current_id)
6666

67-
if "error" in response:
68-
raise Exception(response["error"])
67+
error = response["error"]
68+
if "message" in response:
69+
error_msg = f"{error}: {response['message']}"
70+
raise Exception(error_msg)
6971
else:
7072
result = response["result"]
7173
return self._deserialize_result(result, command)

0 commit comments

Comments
 (0)