mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 14:23:53 +00:00
Merge "Revert "Hygiene: Track minerva errors count only once""
This commit is contained in:
commit
e668cd36d7
|
@ -1,10 +1,5 @@
|
||||||
( function ( M, requestIdleCallback, track, config, trackSubscribe, user, experiments ) {
|
( function ( M, requestIdleCallback, track, config, trackSubscribe, user, experiments ) {
|
||||||
requestIdleCallback( function () {
|
requestIdleCallback( function () {
|
||||||
/**
|
|
||||||
* Errors count in the current pageview
|
|
||||||
* @type {number}
|
|
||||||
*/
|
|
||||||
var errorsCount = 0;
|
|
||||||
/**
|
/**
|
||||||
* Handle an error and log it if necessary
|
* Handle an error and log it if necessary
|
||||||
* @param {string} errorMessage to be logged
|
* @param {string} errorMessage to be logged
|
||||||
|
@ -35,7 +30,7 @@
|
||||||
isAnon: user.isAnon(),
|
isAnon: user.isAnon(),
|
||||||
revision: page.getRevisionId()
|
revision: page.getRevisionId()
|
||||||
};
|
};
|
||||||
errorsCount++;
|
|
||||||
if ( isErrorLoggingEnabled ) {
|
if ( isErrorLoggingEnabled ) {
|
||||||
track( EVENT_CLIENT_ERROR_LOG,
|
track( EVENT_CLIENT_ERROR_LOG,
|
||||||
util.extend( {
|
util.extend( {
|
||||||
|
@ -50,10 +45,8 @@
|
||||||
}, DEFAULT_ERROR_DATA )
|
}, DEFAULT_ERROR_DATA )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
if ( config.get( 'wgMinervaCountErrors' ) ) {
|
||||||
function logErrorsCount() {
|
mw.track( 'counter.MediaWiki.minerva.WebClientError', 1 );
|
||||||
if ( errorsCount > 0 ) {
|
|
||||||
mw.track( 'counter.MediaWiki.minerva.WebClientError', errorsCount );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// track RL exceptions
|
// track RL exceptions
|
||||||
|
@ -65,9 +58,6 @@
|
||||||
trackSubscribe( 'global.error', function ( topic, error ) {
|
trackSubscribe( 'global.error', function ( topic, error ) {
|
||||||
handleError( error.errorMessage, error.lineNumber, error.columnNumber, error.url );
|
handleError( error.errorMessage, error.lineNumber, error.columnNumber, error.url );
|
||||||
} );
|
} );
|
||||||
if ( config.get( 'wgMinervaCountErrors' ) ) {
|
|
||||||
$( window ).on( 'beforeunload', logErrorsCount );
|
|
||||||
}
|
|
||||||
} );
|
} );
|
||||||
}(
|
}(
|
||||||
mw.mobileFrontend,
|
mw.mobileFrontend,
|
||||||
|
|
Loading…
Reference in a new issue