javascript/node/selenium-webdriver/lib/error.js
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;
}
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;
}
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 ; }
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
Checks a response object from a server that adheres to the W3C WebDriver protocol .