From 8ef396d33b2e0174db0b787a6d6f646f6d2a5dba Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 13 Dec 2017 23:45:45 +0100 Subject: [PATCH] mediawiki.loader: Fix logError() not to print exceptions twice MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Current behaviour results in: Chrome 65 (initial) > ▶ [WARN] Error: foo Error: foo > at bar > at main Chrome 65 (expanded) > ▼ [WARN] Error: foo Error: foo > at bar > at main > at logError > at main Safari 11 (initial) > ▶ [WARN] Error: foo, Error: foo Safari 11 (expanded) > ▼ [WARN] Error: foo is undefined > * Error: foo is undefined > at bar > at main Firefox 57 > [WARN] Error: foo | Error: foo > | Stacktrace: > | bar > | main I don't recall why I did it this way, but it seems redundant. This commit effectively removes the first "Error: foo" Change-Id: Idc5dee34ce2b5068e3a2d8800e2b5f6b879525d1 --- resources/src/mediawiki/mediawiki.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 393ab4aabe..6a218e3d25 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -2755,7 +2755,7 @@ // If we have an exception object, log it to the warning channel to trigger // proper stacktraces in browsers that support it. if ( e && console.warn ) { - console.warn( String( e ), e ); + console.warn( e ); } } /* eslint-enable no-console */ -- 2.20.1