switch (errorCode) {
case SUCCESS:
break; // Nothing to do
case 7:
throw new NoSuchElementException(message);
case 8:
throw new NoSuchFrameException(message);
case 9:
throw new UnsupportedOperationException("You may not perform the requested action");
case 10:
throw new StaleElementReferenceException(
String.format("You may not %s this element. It looks as if the reference is stale. " +
"Did you navigate away from the page with this element on?", message));
case 11:
throw new ElementNotVisibleException(
String.format("You may not %s an element that is not displayed", message));
case 12:
throw new UnsupportedOperationException(
String.format("You may not %s an element that is not enabled", message));
case 14:
throw new WebDriverException("An unhandled exception has occured. " + message);
case 15:
throw new UnsupportedOperationException(
String.format("The element appears to be unselectable: %s", message));
case 16:
throw new NoSuchElementException(message + " (no document found)");
case 17:
throw new UnexpectedJavascriptExecutionException(message);
case 21: