Bug 1413292 - Stop sending geckodriver backtrace with errors. r?jgraham draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 31 Oct 2017 20:30:18 +0000
changeset 689654 fd576f3be7518d6b47c62557e18826c0705beef3
parent 689632 3f627210c55d6b2b0a0635683cc4a29102a90270
child 689655 452648fee436a97f6754b6a6c7e53fc7cc6d7fe8
push id87074
push userbmo:ato@sny.no
push dateTue, 31 Oct 2017 20:56:34 +0000
reviewersjgraham
bugs1413292
milestone58.0a1
Bug 1413292 - Stop sending geckodriver backtrace with errors. r?jgraham The Rust backtrace from geckodriver is not useful since any error we actually return is by-definition handled by the code, and we can probably get more information just by looking at the error type and string. At the same time, it runs the risk of confusing users into thinking there was a bug in the driver when actually it's perfectly normal handling of invalid input. MozReview-Commit-ID: 9S5IaioA5AA
testing/geckodriver/CHANGES.md
testing/webdriver/src/error.rs
testing/webdriver/src/lib.rs
--- a/testing/geckodriver/CHANGES.md
+++ b/testing/geckodriver/CHANGES.md
@@ -1,13 +1,22 @@
 Change log
 ==========
 
 All notable changes to this program is documented in this file.
 
+Unreleased
+----------
+
+### Changed
+
+- Backtraces from geckodriver no longer substitute for missing
+  Marionette stacktraces
+
+
 0.19.1 (2017-10-30)
 -------------------
 
 ### Changed
 
 - Search suggestions in the location bar turned off as not to
   trigger network connections
 
@@ -23,17 +32,17 @@ 0.19.1 (2017-10-30)
 
 - Removed obsolete `socksUsername` and `socksPassword` proxy
   configuration keys because neither were picked up or recognised
 
 
 0.19.0 (2017-09-16)
 -------------------
 
-Note that with geckodriver v0.19.0 the following versions are recommended:
+Note that with geckodriver 0.19.0 the following versions are recommended:
 - Firefox 55.0 (and greater)
 - Selenium 3.5 (and greater)
 
 ### Added
 
 - Added endpoint:
   - POST `/session/{session id}/window/minimize` for the [Minimize Window]
     command
--- a/testing/webdriver/src/error.rs
+++ b/testing/webdriver/src/error.rs
@@ -1,9 +1,8 @@
-use backtrace::Backtrace;
 use hyper::status::StatusCode;
 use rustc_serialize::base64::FromBase64Error;
 use rustc_serialize::json::{DecoderError, Json, ParserError, ToJson};
 use std::borrow::Cow;
 use std::collections::BTreeMap;
 use std::convert::From;
 use std::error::Error;
 use std::fmt;
@@ -264,17 +263,17 @@ pub struct WebDriverError {
 
 impl WebDriverError {
     pub fn new<S>(error: ErrorStatus, message: S) -> WebDriverError
         where S: Into<Cow<'static, str>>
     {
         WebDriverError {
             error: error,
             message: message.into(),
-            stack: format!("{:?}", Backtrace::new()).into(),
+            stack: "".into(),
             delete_session: false,
         }
     }
 
     pub fn new_with_stack<S>(error: ErrorStatus, message: S, stack: S) -> WebDriverError
         where S: Into<Cow<'static, str>>
     {
         WebDriverError {
--- a/testing/webdriver/src/lib.rs
+++ b/testing/webdriver/src/lib.rs
@@ -1,11 +1,10 @@
 #![allow(non_snake_case)]
 
-extern crate backtrace;
 #[macro_use]
 extern crate log;
 extern crate rustc_serialize;
 extern crate hyper;
 extern crate regex;
 extern crate cookie;
 extern crate time;
 extern crate url;