Skip to content

Commit fed876e

Browse files
mtorromeodunglas
authored andcommitted
fix: ignore curl exceptions when closing webdriver inside destructor (Fixes #466, fixes #544)
1 parent 649b0a9 commit fed876e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Client.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use Facebook\WebDriver\Exception\NoSuchElementException;
1717
use Facebook\WebDriver\Exception\TimeoutException;
18+
use Facebook\WebDriver\Exception\WebDriverCurlException;
1819
use Facebook\WebDriver\JavaScriptExecutor;
1920
use Facebook\WebDriver\Remote\RemoteWebDriver;
2021
use Facebook\WebDriver\WebDriver;
@@ -107,7 +108,11 @@ public function __wakeup(): void
107108

108109
public function __destruct()
109110
{
110-
$this->quit();
111+
try {
112+
$this->quit();
113+
} catch (WebDriverCurlException) {
114+
// ignore
115+
}
111116
}
112117

113118
public function start(): void

0 commit comments

Comments
 (0)