diff --git a/java/src/org/openqa/selenium/remote/RemoteWebDriver.java b/java/src/org/openqa/selenium/remote/RemoteWebDriver.java index 1dc42ed132c55..deca89f60595d 100644 --- a/java/src/org/openqa/selenium/remote/RemoteWebDriver.java +++ b/java/src/org/openqa/selenium/remote/RemoteWebDriver.java @@ -572,10 +572,14 @@ protected Response execute(CommandPayload payload) { if (e instanceof SessionNotCreatedException) { toThrow = (WebDriverException) e; } else { + // When this exception comes from a remote end, the real cause is usually hidden in the + // cause. Let's try to rescue it and display it at the top level. + String cause = e.getCause() != null ? " " + e.getCause().getMessage() : ""; toThrow = new SessionNotCreatedException( "Possible causes are invalid address of the remote server or browser start-up" - + " failure.", + + " failure." + + cause, e); } } else if (e instanceof WebDriverException) {