webdriver: Rename 'status' field to 'error' to match spec.
authorJames Graham <james@hoppipolla.co.uk>
Mon, 28 Sep 2015 22:30:33 +0100
changeset 428046 f528f8117b98aefede76361f9099ccf78b23fc7a
parent 428045 06374511b47a7e908c009408d9abf3cf362d2caf
child 428047 aa335f696c41411cdfa2e85f59895240c0f42fff
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone57.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
webdriver: Rename 'status' field to 'error' to match spec. Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: 5e1d492f4ee24b740708cfd3a2dd17bda16fa77a
testing/webdriver/src/error.rs
--- a/testing/webdriver/src/error.rs
+++ b/testing/webdriver/src/error.rs
@@ -93,42 +93,42 @@ impl ErrorStatus {
         }
     }
 }
 
 pub type WebDriverResult<T> = Result<T, WebDriverError>;
 
 #[derive(Debug)]
 pub struct WebDriverError {
-    pub status: ErrorStatus,
+    pub error: ErrorStatus,
     pub message: String,
     delete_session: bool
 }
 
 impl fmt::Display for WebDriverError {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         self.message.fmt(f)
     }
 }
 
 impl WebDriverError {
-    pub fn new(status: ErrorStatus, message: &str) -> WebDriverError {
+    pub fn new(error: ErrorStatus, message: &str) -> WebDriverError {
         WebDriverError {
-            status: status,
+            error: error,
             message: message.to_string(),
             delete_session: false
         }
     }
 
     pub fn status_code(&self) -> &'static str {
-        self.status.status_code()
+        self.error.status_code()
     }
 
     pub fn http_status(&self) -> StatusCode {
-        self.status.http_status()
+        self.error.http_status()
     }
 
     pub fn to_json_string(&self) -> String {
         self.to_json().to_string()
     }
 
     pub fn set_delete_session(&mut self) {
         self.delete_session = true
@@ -137,17 +137,17 @@ impl WebDriverError {
     pub fn delete_session(&self) -> bool {
         self.delete_session
     }
 }
 
 impl ToJson for WebDriverError {
     fn to_json(&self) -> Json {
         let mut data = BTreeMap::new();
-        data.insert("status".to_string(), self.status_code().to_json());
+        data.insert("error".to_string(), self.status_code().to_json());
         data.insert("message".to_string(), self.message.to_json());
         Json::Object(data)
     }
 }
 
 impl Error for WebDriverError {
     fn description(&self) -> &str {
         self.status_code()