}
sendMessage(xml);
JSONObject response = handler.getResponse(command.getInt("id"));
JSONObject error = response.optJSONObject("error");
if (error != null) {
throw new RemoteExceptionException(error, command);
} else if (response.optBoolean("wasThrown", false)) {
throw new WebDriverException("remote JS exception " + response.toString(2));
} else {
if (log.isLoggable(Level.FINE)) {
log.fine(