Skip to content

Commit

Permalink
atoms: reorder enums and correct docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andreastt committed Apr 9, 2015
1 parent a286dfa commit 18f77ac
Showing 1 changed file with 35 additions and 37 deletions.
72 changes: 35 additions & 37 deletions javascript/atoms/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,40 @@ goog.provide('bot.ErrorCode');


/**
* Error codes from the WebDriver wire protocol:
* Status strings enumerated in the W3C WebDriver protocol.
* @enum {string}
* @see https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors
*/
bot.Error.State = {
ELEMENT_NOT_SELECTABLE: 'element not selectable',
ELEMENT_NOT_VISIBLE: 'element not visible',
INVALID_ARGUMENT: 'invalid argument',
INVALID_COOKIE_DOMAIN: 'invalid cookie domain',
INVALID_ELEMENT_COORDINATES: 'invalid element coordinates',
INVALID_ELEMENT_STATE: 'invalid element state',
INVALID_SELECTOR: 'invalid selector',
INVALID_SESSION_ID: 'invalid session id',
JAVASCRIPT_ERROR: 'javascript error',
MOVE_TARGET_OUT_OF_BOUNDS: 'move target out of bounds',
NO_SUCH_ALERT: 'no such alert',
NO_SUCH_ELEMENT: 'no such element',
NO_SUCH_FRAME: 'no such frame',
NO_SUCH_WINDOW: 'no such window',
SCRIPT_TIMEOUT: 'script timeout',
SESSION_NOT_CREATED: 'session not created',
STALE_ELEMENT_REFERENCE: 'stale element reference',
TIMEOUT: 'timeout',
UNABLE_TO_SET_COOKIE: 'unable to set cookie',
UNEXPECTED_ALERT_OPEN: 'unexpected alert open',
UNKNOWN_COMMAND: 'unknown command',
UNKNOWN_ERROR: 'unknown error',
UNKNOWN_METHOD: 'unknown method',
UNSUPPORTED_OPERATION: 'unsupported operation'
};


/**
* Error codes from the Selenium WebDriver protocol:
* https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#response-status-codes
*
* @enum {number}
Expand Down Expand Up @@ -66,9 +99,7 @@ bot.ErrorCode = {


/**
* Error extension that includes error status codes from the WebDriver wire
* protocol:
* https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#response-status-codes
* Represents an error returned from a WebDriver command request.
*
* @param {!bot.ErrorCode} code The error's status code.
* @param {string=} opt_message Optional error message.
Expand Down Expand Up @@ -116,39 +147,6 @@ bot.Error = function(code, opt_message) {
goog.inherits(bot.Error, Error);


/**
* Status strings enumerated in the W3C WebDriver working draft.
* @enum {string}
* @see http://www.w3.org/TR/webdriver/#status-codes
*/
bot.Error.State = {
ELEMENT_NOT_SELECTABLE: 'element not selectable',
ELEMENT_NOT_VISIBLE: 'element not visible',
INVALID_ARGUMENT: 'invalid argument',
INVALID_COOKIE_DOMAIN: 'invalid cookie domain',
INVALID_ELEMENT_COORDINATES: 'invalid element coordinates',
INVALID_ELEMENT_STATE: 'invalid element state',
INVALID_SELECTOR: 'invalid selector',
INVALID_SESSION_ID: 'invalid session id',
JAVASCRIPT_ERROR: 'javascript error',
MOVE_TARGET_OUT_OF_BOUNDS: 'move target out of bounds',
NO_SUCH_ALERT: 'no such alert',
NO_SUCH_ELEMENT: 'no such element',
NO_SUCH_FRAME: 'no such frame',
NO_SUCH_WINDOW: 'no such window',
SCRIPT_TIMEOUT: 'script timeout',
SESSION_NOT_CREATED: 'session not created',
STALE_ELEMENT_REFERENCE: 'stale element reference',
TIMEOUT: 'timeout',
UNABLE_TO_SET_COOKIE: 'unable to set cookie',
UNEXPECTED_ALERT_OPEN: 'unexpected alert open',
UNKNOWN_COMMAND: 'unknown command',
UNKNOWN_ERROR: 'unknown error',
UNKNOWN_METHOD: 'unknown method',
UNSUPPORTED_OPERATION: 'unsupported operation'
};


/**
* A map of error codes to state string.
* @private {!Object.<bot.ErrorCode, bot.Error.State>}
Expand Down

0 comments on commit 18f77ac

Please sign in to comment.