mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Set action.saveFailure.message key in Edit schema
This relies on WikimediaMessages' version of the Edit schema being updated at the same time. Change-Id: Iee97fdd2a867f2c252ca7756f2e6341377d9fbb7
This commit is contained in:
parent
70cff83f68
commit
88088d4ecc
|
@ -110,7 +110,8 @@ ve.init.mw.TargetEvents.prototype.onSaveComplete = function ( content, categorie
|
|||
* @param {string} type Text for error type
|
||||
*/
|
||||
ve.init.mw.TargetEvents.prototype.trackSaveError = function ( type ) {
|
||||
var key,
|
||||
var key, data,
|
||||
failureArguments = [],
|
||||
// Maps mwtiming types to mwedit types
|
||||
typeMap = {
|
||||
badtoken: 'userBadToken',
|
||||
|
@ -127,6 +128,10 @@ ve.init.mw.TargetEvents.prototype.trackSaveError = function ( type ) {
|
|||
// (for historical reasons; this sucks)
|
||||
specialTypes = [ 'editconflict' ];
|
||||
|
||||
if ( arguments ) {
|
||||
failureArguments = Array.prototype.slice.call( arguments, 1 );
|
||||
}
|
||||
|
||||
key = 'performance.user.saveError';
|
||||
if ( specialTypes.indexOf( type ) !== -1 ) {
|
||||
key += '.' + type;
|
||||
|
@ -137,10 +142,14 @@ ve.init.mw.TargetEvents.prototype.trackSaveError = function ( type ) {
|
|||
type: type
|
||||
} );
|
||||
|
||||
ve.track( 'mwedit.saveFailure', {
|
||||
data = {
|
||||
type: typeMap[type] || 'responseUnknown',
|
||||
timing: ve.now() - this.timings.saveInitiated + ( this.timings.serializeForCache || 0 )
|
||||
} );
|
||||
};
|
||||
if ( type === 'unknown' && failureArguments[1].error && failureArguments[1].error.code ) {
|
||||
data.message = failureArguments[1].error.code;
|
||||
}
|
||||
ve.track( 'mwedit.saveFailure', data );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -115,11 +115,13 @@
|
|||
event['action.' + action + '.type'] = event.type;
|
||||
event['action.' + action + '.mechanism'] = event.mechanism;
|
||||
event['action.' + action + '.timing'] = Math.round( computeDuration( action, event, timeStamp ) );
|
||||
event['action.' + action + '.message'] = event.message;
|
||||
|
||||
// Remove renamed properties
|
||||
delete event.type;
|
||||
delete event.mechanism;
|
||||
delete event.timing;
|
||||
delete event.message;
|
||||
|
||||
if ( action === 'abort' ) {
|
||||
timing = {};
|
||||
|
|
Loading…
Reference in a new issue