Skip to content

Commit a0c9824

Browse files
committed
add the useful information about the session / capabilities in the exception when the 'browser may have died'
1 parent ab740c5 commit a0c9824

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,14 @@ protected Response execute(String driverCommand, Map<String, ?> parameters) {
657657
errorMessage = "Could not start a new session. Possible causes are " +
658658
"invalid address of the remote server or browser start-up failure.";
659659
}
660-
throw new UnreachableBrowserException(errorMessage, e);
660+
UnreachableBrowserException ube = new UnreachableBrowserException(errorMessage, e);
661+
if (getSessionId() != null) {
662+
ube.addInfo(WebDriverException.SESSION_ID, getSessionId().toString());
663+
}
664+
if (getCapabilities() != null) {
665+
ube.addInfo("Capabilities", getCapabilities().toString());
666+
}
667+
throw ube;
661668
} finally {
662669
Thread.currentThread().setName(currentName);
663670
}

0 commit comments

Comments
 (0)