Module: Selenium::WebDriver::BiDi::Protocol::ErrorCode

Defined in:
lib/selenium/webdriver/bidi/protocol/error_code.rb,
lib/selenium/webdriver/bidi/error.rb

Overview

The BiDi ErrorCode enum: each wire value mapped to its Ruby exception class name.

Constant Summary collapse

CLASS_NAMES =
{
  'invalid argument' => 'InvalidArgumentError',
  'invalid selector' => 'InvalidSelectorError',
  'invalid session id' => 'InvalidSessionIdError',
  'invalid web extension' => 'InvalidWebExtensionError',
  'move target out of bounds' => 'MoveTargetOutOfBoundsError',
  'no such alert' => 'NoSuchAlertError',
  'no such network collector' => 'NoSuchNetworkCollectorError',
  'no such element' => 'NoSuchElementError',
  'no such frame' => 'NoSuchFrameError',
  'no such handle' => 'NoSuchHandleError',
  'no such history entry' => 'NoSuchHistoryEntryError',
  'no such intercept' => 'NoSuchInterceptError',
  'no such network data' => 'NoSuchNetworkDataError',
  'no such node' => 'NoSuchNodeError',
  'no such request' => 'NoSuchRequestError',
  'no such screencast' => 'NoSuchScreencastError',
  'no such script' => 'NoSuchScriptError',
  'no such storage partition' => 'NoSuchStoragePartitionError',
  'no such user context' => 'NoSuchUserContextError',
  'no such web extension' => 'NoSuchWebExtensionError',
  'session not created' => 'SessionNotCreatedError',
  'unable to capture screen' => 'UnableToCaptureScreenError',
  'unable to close browser' => 'UnableToCloseBrowserError',
  'unable to set cookie' => 'UnableToSetCookieError',
  'unable to set file input' => 'UnableToSetFileInputError',
  'unavailable network data' => 'UnavailableNetworkDataError',
  'underspecified storage partition' => 'UnderspecifiedStoragePartitionError',
  'unknown command' => 'UnknownCommandError',
  'unknown error' => 'UnknownError',
  'unsupported operation' => 'UnsupportedOperationError'
}.freeze

Class Method Summary collapse

Class Method Details

.for(code) ⇒ Object

The exception class for a wire error code, or WebDriverError for an unknown one.



36
37
38
39
# File 'lib/selenium/webdriver/bidi/error.rb', line 36

def self.for(code)
  name = code && CLASS_NAMES[code]
  name ? Error.const_get(name) : Error::WebDriverError
end