From: Timo Tijhof Date: Wed, 13 Dec 2017 22:45:45 +0000 (+0100) Subject: mediawiki.loader: Fix logError() not to print exceptions twice X-Git-Tag: 1.31.0-rc.0~1197^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=8ef396d33b2e0174db0b787a6d6f646f6d2a5dba;p=lhc%2Fweb%2Fwiklou.git mediawiki.loader: Fix logError() not to print exceptions twice 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 --- 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 */