From 5e0a5046488fa25fd82fdb6b241dfa683b049251 Mon Sep 17 00:00:00 2001 From: Massimiliano Torromeo Date: Sun, 21 Aug 2022 23:07:35 +0200 Subject: [PATCH] fix: ignore curl exceptions when closing webdriver inside destructor (Fixes #466, fixes #544) --- src/Client.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 6b25cef6..3285eda2 100644 --- a/src/Client.php +++ b/src/Client.php @@ -15,6 +15,7 @@ use Facebook\WebDriver\Exception\NoSuchElementException; use Facebook\WebDriver\Exception\TimeoutException; +use Facebook\WebDriver\Exception\WebDriverCurlException; use Facebook\WebDriver\JavaScriptExecutor; use Facebook\WebDriver\Remote\RemoteWebDriver; use Facebook\WebDriver\WebDriver; @@ -105,7 +106,11 @@ public function __wakeup(): void public function __destruct() { - $this->quit(); + try { + $this->quit(); + } catch (WebDriverCurlException) { + // ignore + } } public function start(): void