File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
py/selenium/webdriver/remote Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 2222
2323from websocket import WebSocketApp # type: ignore
2424
25+ from selenium .common import WebDriverException
26+
2527logger = logging .getLogger (__name__ )
2628
2729
@@ -68,9 +70,9 @@ def execute(self, command):
6870 error = response ["error" ]
6971 if "message" in response :
7072 error_msg = f"{ error } : { response ['message' ]} "
71- raise Exception (error_msg )
73+ raise WebDriverException (error_msg )
7274 else :
73- raise Exception (error )
75+ raise WebDriverException (error )
7476 else :
7577 result = response ["result" ]
7678 return self ._deserialize_result (result , command )
@@ -102,7 +104,7 @@ def _serialize_command(self, command):
102104 def _deserialize_result (self , result , command ):
103105 try :
104106 _ = command .send (result )
105- raise Exception ("The command's generator function did not exit when expected!" )
107+ raise WebDriverException ("The command's generator function did not exit when expected!" )
106108 except StopIteration as exit :
107109 return exit .value
108110
You can’t perform that action at this time.
0 commit comments