Bug 1469601 - [webdriver] Fix Add Cookie command to raise an "invalid argument" error if parameters are null. r=ato
authorHenrik Skupin <mail@hskupin.info>
Tue, 14 Aug 2018 17:25:17 +0200
changeset 431704 052b350b861bbc68c4400cd3909c4e81fadd0d3c
parent 431703 cba97273eb10aa51a654d7a802c843b3e149b903
child 431705 7915b80eca091d53838f20594e84ed543b1752f3
push id34451
push userebalazs@mozilla.com
push dateThu, 16 Aug 2018 09:25:15 +0000
treeherdermozilla-central@161817e6d127 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1469601
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1469601 - [webdriver] Fix Add Cookie command to raise an "invalid argument" error if parameters are null. r=ato
testing/webdriver/src/command.rs
--- a/testing/webdriver/src/command.rs
+++ b/testing/webdriver/src/command.rs
@@ -912,17 +912,17 @@ pub struct AddCookieParameters {
 impl Parameters for AddCookieParameters {
     fn from_json(body: &Json) -> WebDriverResult<AddCookieParameters> {
         if !body.is_object() {
             return Err(WebDriverError::new(ErrorStatus::InvalidArgument,
                                            "Message body was not an object"));
         }
 
         let data = try_opt!(body.find("cookie").and_then(|x| x.as_object()),
-                            ErrorStatus::UnableToSetCookie,
+                            ErrorStatus::InvalidArgument,
                             "Cookie parameter not found or not an object");
 
         let name = try_opt!(
             try_opt!(data.get("name"),
                      ErrorStatus::InvalidArgument,
                      "Missing 'name' parameter").as_string(),
             ErrorStatus::InvalidArgument,
             "'name' is not a string").to_string();