Namespace bot.response

code »
Show:

Type Definitions

code »bot.response.ResponseObject : {status: bot.ErrorCode, value: (*|{message: string})}
Type definition for a response object, as defined by the JSON wire protocol.

Global Functions

Checks that a response object does not specify an error as defined by the WebDriver wire protocol. If the response object defines an error, it will be thrown. Otherwise, the response will be returned as is.

Parameters
responseObj: !bot.response.ResponseObject
The response object to check.
Returns
The checked response object.
Throws
bot.Error
If the response describes an error.

Converts an error value into its JSON representation as defined by the WebDriver wire protocol.

Parameters
error: (bot.Error|Error|*)
The error value to convert.
Returns
The new response object.

Creates a new success response object with the provided value.

Parameters
value: *
The response value.
Returns
The new response object.
Parameters
value: *
The value to test.
Returns
Whether the given value is a response object.