mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-15 02:13:49 +00:00
8ee17cf2b0
We are counting errors rather than sending them via EventLogging. This code is thus being shipped unnecessarily to our users and is not ever enabled in production Given our work to use Sentry (T106915) let's remove this code. Bug: T233663 Change-Id: I71ef7377e91e38f9ccc13493d52ab629d433f8f4
26 lines
600 B
JavaScript
26 lines
600 B
JavaScript
( function ( track, config, trackSubscribe, user ) {
|
|
module.exports = function () {
|
|
var suffix = user.isAnon() ? '.anon' : '.loggedin',
|
|
COUNTER_NAME = 'counter.MediaWiki.minerva.WebClientError' + suffix;
|
|
|
|
/**
|
|
* Count javascript error
|
|
*/
|
|
function countError() {
|
|
track( COUNTER_NAME, 1 );
|
|
}
|
|
|
|
if ( config.get( 'wgMinervaCountErrors' ) ) {
|
|
// track RL exceptions
|
|
trackSubscribe( 'resourceloader.exception', countError );
|
|
// setup the global error handler
|
|
trackSubscribe( 'global.error', countError );
|
|
}
|
|
};
|
|
}(
|
|
mw.track,
|
|
mw.config,
|
|
mw.trackSubscribe,
|
|
mw.user
|
|
) );
|