Skip to content

Commit

Permalink
Reset driver connection even if stopping the driver fails (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols authored Aug 29, 2024
1 parent 80c03d5 commit b3c68c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/WebDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ public function stop()

try {
$this->webDriver->quit();
$this->webDriver = null;
} catch (\Exception $e) {
throw new DriverException('Could not close connection', 0, $e);
} finally {
// Note: The finally section will be executed before the DriverException is thrown.
$this->webDriver = null;
}
}

Expand Down

0 comments on commit b3c68c5

Please sign in to comment.