From d4ad59a66cc26f8e64a21891e20a26b5e8a0c794 Mon Sep 17 00:00:00 2001 From: Kevin Bond Date: Sun, 27 Apr 2025 18:58:37 -0400 Subject: [PATCH] fix(panther): ??? --- src/Browser/Session.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Browser/Session.php b/src/Browser/Session.php index 0077f4b..03b4983 100644 --- a/src/Browser/Session.php +++ b/src/Browser/Session.php @@ -166,7 +166,14 @@ private function ensureNoException(): void $crawler = $this->client()->getCrawler(); - if (!\count($exceptionClassNode = $crawler->filter('.trace-details .trace-class')->first())) { + try { + $exceptionClassNode = $crawler->filter('.trace-details .trace-class')->first(); + } catch (\Throwable) { + // for some reason, sometimes, with panther a `Facebook\WebDriver\Exception\StaleElementReferenceException` is thrown here + return; + } + + if (!\count($exceptionClassNode)) { return; }