Skip to content

Commit ef0ea80

Browse files
authored
Improper Exception Handling in _closeSession Function (#133)
1 parent 9f9537a commit ef0ea80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Codeception/Module/WebDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
use Facebook\WebDriver\Exception\InvalidElementStateException;
4040
use Facebook\WebDriver\Exception\InvalidSelectorException;
4141
use Facebook\WebDriver\Exception\NoSuchElementException;
42-
use Facebook\WebDriver\Exception\UnknownErrorException;
42+
use Facebook\WebDriver\Exception\PhpWebDriverExceptionInterface;
4343
use Facebook\WebDriver\Interactions\WebDriverActions;
4444
use Facebook\WebDriver\Remote\LocalFileDetector;
4545
use Facebook\WebDriver\Remote\RemoteWebDriver;
@@ -1749,7 +1749,7 @@ public function _closeSession($webDriver = null): void
17491749
try {
17501750
$webDriver->quit();
17511751
unset($webDriver);
1752-
} catch (UnknownErrorException $exception) {
1752+
} catch (PhpWebDriverExceptionInterface $exception) {
17531753
// Session already closed so nothing to do
17541754
}
17551755
}

0 commit comments

Comments
 (0)