for discussion - a change to exception handling that originates in chromedriver.exe. Specifically, while 'this version of chromedriver supports v111 and /full/path/to/chrome.exe is v112' is a decent message, it does not communicate where 'this' is as a fully qualified path. A try/catch/wrap/rethrow strategy can add the extra path detail that was missing. This may be useful to end users who inadvertently have many chromedriver.exes on their machine \(via different means\) and don't know which one to attempt to upgrade in order to push through the v111:v112 snafu. A person might be in that pickle cos they've clone many repos and run the project's choice of build which many have bought chromdriver.exe down many times to different locations.
diff --git a/java/src/org/openqa/selenium/remote/service/DriverService.java b/java/src/org/openqa/selenium/remote/service/DriverService.java
index 0e6dd1f..cd76b10 100644
--- a/java/src/org/openqa/selenium/remote/service/DriverService.java
+++ b/java/src/org/openqa/selenium/remote/service/DriverService.java
@@ -247,6 +247,12 @@ public void start() throws IOException {
}
} catch (ExecutionException | TimeoutException e) {
throw new WebDriverException("Timed out waiting for driver server to start.", e);
+ } catch (org.openqa.selenium.SessionNotCreatedException e) {
+ if (e.getMessage().contains("This version of ChromeDriver only supports")) {
+ throw new org.openqa.selenium.SessionNotCreatedException("Context: chromedriver executable path is " + this.executable, e);
+ } else {
+ throw e;
+ }
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new WebDriverException("Timed out waiting for driver server to start.", e);