Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396099 )

Change subject: Further reduce mocha noise by suppressing unnecessary stacks
......................................................................

Further reduce mocha noise by suppressing unnecessary stacks

Change-Id: I2dff85ad1ab9e93ab1aeead352688553ad0e0612
---
M lib/api/routes.js
M lib/html2wt/DOMHandlers.js
2 files changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/99/396099/1

diff --git a/lib/api/routes.js b/lib/api/routes.js
index f7969db..6917969 100644
--- a/lib/api/routes.js
+++ b/lib/api/routes.js
@@ -25,11 +25,8 @@
        // is setup.  The logger doesn't emit the expected location info.
        // You probably want `apiUtils.fatalRequest` instead.
        var errOut = function(res, text, httpStatus) {
-               var err = new Error(text);
-               err.httpStatus = httpStatus || 404;
-               err.suppressLoggingStack = true;
-               processLogger.log('fatal/request', err);
-               apiUtils.errorResponse(res, text, err.httpStatus);
+               processLogger.log('fatal/request', text);
+               apiUtils.errorResponse(res, text, httpStatus || 404);
        };
 
        // Middlewares
diff --git a/lib/html2wt/DOMHandlers.js b/lib/html2wt/DOMHandlers.js
index dcf51a2..d6984a4 100644
--- a/lib/html2wt/DOMHandlers.js
+++ b/lib/html2wt/DOMHandlers.js
@@ -1436,6 +1436,7 @@
        this.name = 'Bad Request';
        this.message = message || 'Bad Request';
        this.httpStatus = 400;
+       this.suppressLoggingStack = true;
 }
 ClientError.prototype = Error.prototype;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/396099
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2dff85ad1ab9e93ab1aeead352688553ad0e0612
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <abrea...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to