Skip to content

Commit 6b89375

Browse files
committed
check 'error'
1 parent 386ecc3 commit 6b89375

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

py/selenium/webdriver/remote/websocket_connection.py

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

67-
error = response["error"]
68-
if "message" in response:
69-
error_msg = f"{error}: {response['message']}"
70-
raise Exception(error_msg)
67+
if "error" in response:
68+
error = response["error"]
69+
if "message" in response:
70+
error_msg = f"{error}: {response['message']}"
71+
raise Exception(error_msg)
72+
else:
73+
raise Exception(error)
7174
else:
7275
result = response["result"]
7376
return self._deserialize_result(result, command)

0 commit comments

Comments
 (0)