File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 18
18
use HeadlessChromium \Exception \CommunicationException \InvalidResponse ;
19
19
use HeadlessChromium \Exception \CommunicationException \CannotReadResponse ;
20
20
use HeadlessChromium \Exception \OperationTimedOut ;
21
+ use HeadlessChromium \Exception \TargetDestroyed ;
21
22
use Psr \Log \LoggerAwareInterface ;
22
23
use Psr \Log \LoggerAwareTrait ;
23
24
use Psr \Log \LoggerInterface ;
@@ -245,6 +246,8 @@ public function createSession($targetId): Session
245
246
$ response = $ this ->sendMessageSync (
246
247
new Message ('Target.attachToTarget ' , ['targetId ' => $ targetId ])
247
248
);
249
+ if (empty ($ response ['result ' ]))
250
+ throw new TargetDestroyed ('The target was destroyed. ' );
248
251
$ sessionId = $ response ['result ' ]['sessionId ' ];
249
252
$ session = new Session ($ targetId , $ sessionId , $ this );
250
253
You can’t perform that action at this time.
0 commit comments