Skip to content

Commit

Permalink
See if we can catch the exceptions that cause the behat to crash outr…
Browse files Browse the repository at this point in the history
…ight
  • Loading branch information
acoulton committed Sep 15, 2022
1 parent a716a7b commit 9a5881a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/ChromeDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,21 @@ public function stop()
*/
public function reset()
{
$this->ensureStarted();
$this->document = 'document';
$this->deleteAllCookies();
$this->connectToWindow($this->main_window);
$this->page->reset();
$this->request_headers = [];
$this->sendRequestHeaders();
try {
$this->ensureStarted();
$this->document = 'document';
$this->deleteAllCookies();
$this->connectToWindow($this->main_window);
$this->page->reset();
$this->request_headers = [];
$this->sendRequestHeaders();
} catch (DriverException $e) {
\fwrite(
STDOUT,
"ERROR: Could not reset - ".$e->getMessage()."\n".$e->getTraceAsString()
);
// What happens if we just allow the scenario to continue here????
}
}

/**
Expand Down

0 comments on commit 9a5881a

Please sign in to comment.