Class ErrorCodes


  • public class ErrorCodes
    extends java.lang.Object
    Defines common error codes for the wire protocol.
    • Constructor Detail

      • ErrorCodes

        public ErrorCodes()
    • Method Detail

      • toState

        public java.lang.String toState​(java.lang.Integer status)
      • toStatus

        public int toStatus​(java.lang.String webdriverState,
                            java.util.Optional<java.lang.Integer> httpStatus)
      • getHttpStatusCode

        public int getHttpStatusCode​(java.lang.Throwable throwable)
      • getExceptionType

        public java.lang.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 java.lang.Class<? extends org.openqa.selenium.WebDriverException> getExceptionType​(java.lang.String webdriverState)
      • toStatusCode

        public int toStatusCode​(java.lang.Throwable e)
      • isMappableError

        public boolean isMappableError​(java.lang.Throwable rootCause)