Class ErrorCodes

java.lang.Object
org.openqa.selenium.remote.ErrorCodes

public class ErrorCodes extends Object
Defines common error codes for the wire protocol.
  • Field Details

  • Constructor Details

    • ErrorCodes

      public ErrorCodes()
  • Method Details

    • toState

      public String toState(Integer status)
    • toStatus

      public int toStatus(String webdriverState, Optional<Integer> httpStatus)
    • getHttpStatusCode

      public int getHttpStatusCode(Throwable throwable)
    • getExceptionType

      public Class<? extends org.openqa.selenium.WebDriverException> getExceptionType(int statusCode)
      Returns the exception type that corresponds to the given statusCode. All unrecognized status codes will be mapped to WebDriverException.class.
      Parameters:
      statusCode - The status code to convert.
      Returns:
      The exception type that corresponds to the provided status code or null if statusCode == 0.
    • getExceptionType

      public Class<? extends org.openqa.selenium.WebDriverException> getExceptionType(String webdriverState)
    • toStatusCode

      public int toStatusCode(Throwable e)
    • isMappableError

      public boolean isMappableError(Throwable rootCause)