Constructor
new Response(msgID, respHandler)
Parameters:
Name | Type | Description |
---|---|---|
msgID |
number | Message ID tied to the corresponding command request this is a response for. |
respHandler |
ResponseHandler | Function callback called on sending the response. |
- Source:
Methods
send()
Sends response using the response handler provided on construction.
- Source:
Throws:
-
If the response has already been sent.
- Type
- RangeError
sendConditionally(predicate)
Sends response conditionally, given a predicate.
Parameters:
Name | Type | Description |
---|---|---|
predicate |
function | A predicate taking a Response object and returning a boolean. |
- Source:
sendError(err)
Send given Error to client.
Turns the response into an error response, clears any previously set body data, and sends it using the response handler provided on construction.
Parameters:
Name | Type | Description |
---|---|---|
err |
Error | The Error instance to send. |
- Source:
Throws:
-
If the {@code error} is not a WebDriverError, the error is propagated.
- Type
- Error