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):
168
168
command = "Target.closeTarget" ,
169
169
params = {"targetId" : target },
170
170
)
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" ])
174
173
print (f"The tab { target } has been closed" )
175
174
self .remove_tab (target )
176
175
return response
Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ async def close_session(self, session):
50
50
command = "Target.detachFromTarget" ,
51
51
params = {"sessionId" : session },
52
52
)
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
+ )
56
57
print (f"The session { session } has been closed" )
57
58
self .remove_session (session )
58
59
return response
You can’t perform that action at this time.
0 commit comments