Skip to content

Commit 0bd2a22

Browse files
committed
fix headless browser bugs: catch headless lib's exception properly
1 parent 7d0b889 commit 0bd2a22

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.js linguist-language=PHP
22
*.css linguist-language=PHP
33
*.html linguist-language=PHP
4+
*.c linguist-language=C

src/Kernel/Middleware/HeadlessBrowser/Chrome.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,12 @@ public function request($method, $url, $args = [])
262262
]));
263263
}
264264

265-
$page = self::getPage();
266-
267265
try{
266+
$page = self::getPage();
268267
$page->navigate($url)->waitForNavigation($page_event, $navigate_timeout);
269268
$html = $page->getHtml();
270269
$page->close();
271270
}catch(\Throwable $e){
272-
$page->close();
273271
//since the headless lib don't define an exception code,
274272
//so we have to define a uniform exception code here....
275273
throw new \Exception($e->getMessage(), -400);

src/Kernel/PHPCreeper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class PHPCreeper extends Worker
4040
*
4141
* @var string
4242
*/
43-
public const CURRENT_VERSION = '1.9.8';
43+
public const CURRENT_VERSION = '1.9.9';
4444

4545
/**
4646
* engine name

0 commit comments

Comments
 (0)