MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / toState

Method toState

java/src/org/openqa/selenium/remote/ErrorCodes.java:299–316  ·  view source on GitHub ↗
(@Nullable Integer status)

Source from the content-addressed store, hash-verified

297 }
298
299 public String toState(@Nullable Integer status) {
300 if (status == null) {
301 return toState(UNHANDLED_ERROR);
302 }
303
304 if (SUCCESS == status) {
305 return SUCCESS_STRING;
306 }
307
308 Set<String> possibleMatches =
309 KNOWN_ERRORS.stream()
310 .filter(knownError -> knownError.getJsonCode() == status)
311 .filter(KnownError::isCanonicalForW3C)
312 .map(KnownError::getW3cCode)
313 .collect(Collectors.toSet());
314
315 return onlyElement(possibleMatches, "unhandled error");
316 }
317
318 public int toStatus(String webdriverState, Optional<Integer> httpStatus) {
319 if (SUCCESS_STRING.equals(webdriverState)) {

Callers 3

createResponseMethod · 0.80
createErrorMethod · 0.80
fromJsonMethod · 0.80

Calls 6

onlyElementMethod · 0.95
collectMethod · 0.80
filterMethod · 0.80
getJsonCodeMethod · 0.80
mapMethod · 0.45
streamMethod · 0.45

Tested by 2

createResponseMethod · 0.64
createErrorMethod · 0.64