Exclude localStorage errors from error-logging

Bug: T253084
Change-Id: I1117be62d5a5ae0725836fae49fd325a07b0f83d
This commit is contained in:
Jan Drewniak 2020-05-26 13:08:48 +02:00
parent 07baf70613
commit 145d23ee0f

View file

@ -4,10 +4,16 @@
COUNTER_NAME = 'counter.MediaWiki.minerva.WebClientError' + suffix;
/**
* Count javascript error
* Count javascript errors, except for those associated with localStorage
* being full or unavailable.
* @param {string} topic name of the event being tracked
* @param {Object} data event payload
*/
function countError() {
track( COUNTER_NAME, 1 );
function countError( topic, data ) {
var isLocalStorage = data && data.source === 'store-localstorage-update';
if ( !isLocalStorage ) {
track( COUNTER_NAME, 1 );
}
}
if ( config.get( 'wgMinervaCountErrors' ) ) {