Bug 1155658: Rename "illegal argument" error to "invalid argument"

r=chmanchester
This commit is contained in:
Andreas Tolfsen 2015-04-17 18:43:05 +01:00
parent 863a2970f8
commit 9537715638
3 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;
}