code: function checkResponse(data) {
    if (data && typeof data.error === 'string') {
      let ctor = ERROR_CODE_TO_TYPE.get(data.error) || WebDriverError;
      throw new ctor(data.message);
    }
    return data;
  }
docs: Checks a response object from a server that adheres to the W3C WebDriver
  protocol.
  @param {*} data The response data to check.
  @return {*} The response data if it was not an encoded error.
  @throws {WebDriverError} the decoded error, if present in the data object.
  @deprecated Use {@link #throwDecodedError(data)} instead.
  @see https://w3c.github.io/webdriver/webdriver-spec.html#protocol