Skip to content

Commit

Permalink
Attempt to fix a problem with incorrectly mapped status codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Oct 12, 2016
1 parent 941333c commit 6c287b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions java/client/src/org/openqa/selenium/remote/ErrorCodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public class ErrorCodes {
.put(400,
ImmutableSortedSet.<StatusTuple>naturalOrder()
.add(new StatusTuple("element not selectable", ELEMENT_NOT_SELECTABLE, ElementNotSelectableException.class))
.add(new StatusTuple("element not interactable", INVALID_ELEMENT_STATE, ElementNotInteractableException.class))
.add(new StatusTuple("element not interactable", ELEMENT_NOT_VISIBLE, ElementNotVisibleException.class))
.add(new StatusTuple("element not interactable", INVALID_ELEMENT_STATE, ElementNotInteractableException.class, INVALID_ELEMENT_STATE))
.add(new StatusTuple("element not interactable", ELEMENT_NOT_VISIBLE, ElementNotVisibleException.class, INVALID_ELEMENT_STATE))
.add(new StatusTuple("element not visible", ELEMENT_NOT_VISIBLE, ElementNotVisibleException.class))
.add(new StatusTuple("invalid argument", UNHANDLED_ERROR, InvalidArgumentException.class))
.add(new StatusTuple("invalid cookie domain", INVALID_COOKIE_DOMAIN, InvalidCookieDomainException.class))
Expand Down Expand Up @@ -177,6 +177,7 @@ public class ErrorCodes {
ALL_CODES.values().stream()
.flatMap(Collection::stream)
.filter(tuple -> tuple.getException() != null)
.filter(tuple -> tuple.jsonStatus == tuple.seleniumExceptionToResponseCode)
.collect(Collectors.toMap(StatusTuple::asState, StatusTuple::getException, (key1, key2) -> key1));

public String toState(Integer status) {
Expand Down

0 comments on commit 6c287b2

Please sign in to comment.