code: public static String extractMessage(Throwable e) {
      String msg = e.getMessage();
      return msg == null ? "" : (e instanceof WebDriverException) ? msg.split("\n")[0] : msg;
    }
docs: Webdriver exception have debug info for the client. polluting server side.