mediawiki-skins-MinervaNeue/resources/skins.minerva.scripts/errorLogging.js
jdlrobson 8ee17cf2b0 Remove wgMinervaErrorLogSamplingRate
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
2019-10-03 14:57:14 +00:00

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
) );