File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -168,9 +168,8 @@ async def close_tab(self, target):
168168 command = "Target.closeTarget" ,
169169 params = {"targetId" : target },
170170 )
171- error = self .protocol .get_error (response )
172- if error :
173- raise RuntimeError ("Could not close tab" ) from Exception (error )
171+ if "error" in response :
172+ raise RuntimeError ("Could not close tab" ) from Exception (response ["error" ])
174173 print (f"The tab { target } has been closed" )
175174 self .remove_tab (target )
176175 return response
Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ async def close_session(self, session):
5050 command = "Target.detachFromTarget" ,
5151 params = {"sessionId" : session },
5252 )
53- error = self .protocol .get_error (response )
54- if error :
55- raise RuntimeError ("Could not close session" ) from Exception (error )
53+ if "error" in response :
54+ raise RuntimeError ("Could not close session" ) from Exception (
55+ response ["error" ]
56+ )
5657 print (f"The session { session } has been closed" )
5758 self .remove_session (session )
5859 return response
You can’t perform that action at this time.
0 commit comments