webdriver
Advanced tools
Comparing version
@@ -130,3 +130,3 @@ "use strict"; | ||
if (error.stack.includes('stale element reference')) { | ||
if (error.name === 'stale element reference') { | ||
log.warn('Request encountered a stale element - terminating request'); | ||
@@ -133,0 +133,0 @@ this.emit('response', { |
@@ -19,2 +19,3 @@ "use strict"; | ||
exports.getErrorFromResponseBody = getErrorFromResponseBody; | ||
exports.CustomRequestError = void 0; | ||
@@ -324,3 +325,3 @@ var _logger = _interopRequireDefault(require("@wdio/logger")); | ||
* @param {Object} body body object | ||
* @return {String} error message | ||
* @return {Object} error | ||
*/ | ||
@@ -342,3 +343,14 @@ | ||
return new Error(body.value.message || body.value.class || 'unknown error'); | ||
} | ||
return new CustomRequestError(body); | ||
} //Exporting for testability | ||
class CustomRequestError extends Error { | ||
constructor(body) { | ||
super(body.value.message || body.value.class || 'unknown error'); | ||
if (body.value.error) this.name = body.value.error; | ||
} | ||
} | ||
exports.CustomRequestError = CustomRequestError; |
{ | ||
"name": "webdriver", | ||
"version": "5.4.9", | ||
"version": "5.4.10", | ||
"description": "A Node.js bindings implementation for the W3C WebDriver and Mobile JSONWire Protocol", | ||
@@ -38,3 +38,3 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
}, | ||
"gitHead": "dec6d38813266dd2fd073296c8141d11a444f5d7" | ||
"gitHead": "713f02100ed4aeb2ce549bfc1e23ae00f05d2f38" | ||
} |
197411
0.13%5222
0.15%