From 5ade32492fe0a32a09b5cffa2f684788db42ccd8 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Fri, 17 Apr 2015 18:43:05 +0100 Subject: [PATCH] Bug 1155658: Rename "illegal argument" error to "invalid argument" r=chmanchester --HG-- extra : rebase_source : b49c8bcaa30b470ae372182a83b6085ae94ddb7f --- testing/marionette/driver.js | 4 ++-- testing/marionette/error.js | 10 +++++----- testing/marionette/listener.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js index 0067e7fef8ab..6cafec65c615 100644 --- a/testing/marionette/driver.js +++ b/testing/marionette/driver.js @@ -2308,7 +2308,7 @@ GeckoDriver.prototype.sendKeysToElement = function(cmd, resp) { let {id, value} = cmd.parameters; if (!value) { - throw new IllegalArgumentError(`Expected character sequence: ${value}`); + throw new InvalidArgumentError(`Expected character sequence: ${value}`); } switch (this.context) { @@ -2341,7 +2341,7 @@ GeckoDriver.prototype.sendKeysToElement = function(cmd, resp) { try { file = new File(val); } catch (e) { - err = new IllegalArgumentError(`File not found: ${val}`); + err = new InvalidArgumentError(`File not found: ${val}`); } fs.push(file); el.mozSetFileArray(fs); diff --git a/testing/marionette/error.js b/testing/marionette/error.js index 347cc6a76789..5a3b4c14572e 100644 --- a/testing/marionette/error.js +++ b/testing/marionette/error.js @@ -11,7 +11,7 @@ const errors = [ "ElementNotVisibleError", "FrameSendFailureError", "FrameSendNotInitializedError", - "IllegalArgumentError", + "InvalidArgumentError", "InvalidElementStateError", "InvalidSelectorError", "InvalidSessionIdError", @@ -171,12 +171,12 @@ this.FrameSendNotInitializedError = function(frame) { }; FrameSendNotInitializedError.prototype = Object.create(WebDriverError.prototype); -this.IllegalArgumentError = function(msg) { +this.InvalidArgumentError = function(msg) { WebDriverError.call(this, msg); - this.name = "IllegalArgumentError"; - this.status = "illegal argument"; + this.name = "InvalidArgumentError"; + this.status = "invalid argument"; }; -IllegalArgumentError.prototype = Object.create(WebDriverError.prototype); +InvalidArgumentError.prototype = Object.create(WebDriverError.prototype); this.InvalidElementStateError = function(msg) { WebDriverError.call(this, msg); diff --git a/testing/marionette/listener.js b/testing/marionette/listener.js index 5f0014a73668..55ee463bfeb7 100644 --- a/testing/marionette/listener.js +++ b/testing/marionette/listener.js @@ -1562,7 +1562,7 @@ function sendKeysToElement(msg) { try { file = new File(p); } catch (e) { - let err = new IllegalArgumentError(`File not found: ${val}`); + let err = new InvalidArgumentError(`File not found: ${val}`); sendError(err, command_id); return; }