Bug 1333014 - Remove unused error.wrap; r?maja_zf draft
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 03 Feb 2017 19:26:56 +0000
changeset 479457 2561453770f14c8b8f6ee9056fd656231133e482
parent 479417 7f1b358fb17dfd982c5e18c34d5735cd481c7f7c
child 479458 188a8f00ffc1c26091d9ede2284536ccfb8ae7d1
push id44264
push userbmo:ato@mozilla.com
push dateMon, 06 Feb 2017 19:13:44 +0000
reviewersmaja_zf
bugs1333014
milestone54.0a1
Bug 1333014 - Remove unused error.wrap; r?maja_zf MozReview-Commit-ID: 5i8qg7JzTJA
testing/marionette/error.js
--- a/testing/marionette/error.js
+++ b/testing/marionette/error.js
@@ -76,27 +76,16 @@ error.isError = function (val) {
  * Checks if obj is an object in the WebDriverError prototypal chain.
  */
 error.isWebDriverError = function (obj) {
   return error.isError(obj) &&
       ("name" in obj && ERRORS.has(obj.name));
 };
 
 /**
- * Wraps an Error prototype in a WebDriverError.  If the given error is
- * already a WebDriverError, this is effectively a no-op.
- */
-error.wrap = function (err) {
-  if (error.isWebDriverError(err)) {
-    return err;
-  }
-  return new WebDriverError(`${err.name}: ${err.message}`, err.stack);
-};
-
-/**
  * Wraps an Error as a WebDriverError type.  If the given error is already
  * in the WebDriverError prototype chain, this function acts as a no-op.
  */
 error.wrap = function (err) {
   if (error.isWebDriverError(err)) {
     return err;
   }
   return new WebDriverError(err.message, err.stacktrace);