Follow-up 2c24efae: fix typo in event name for unknown save errors

This probably means we stopped logging unknown save errors
back in August.

Change-Id: I4a5bac244a469e73643e8a7d978d9212dd838fb0
This commit is contained in:
Roan Kattouw 2016-03-04 16:46:12 -08:00
parent 4ed6fd4010
commit 84d534997e
2 changed files with 12 additions and 11 deletions

View file

@ -120,6 +120,7 @@ OO.inheritClass( ve.init.mw.ArticleTarget, ve.init.mw.Target );
/**
* @event saveErrorUnknown
* @param {string} errorMsg Error message shown to the user
* Fired for any other type of save error
*/
@ -654,20 +655,20 @@ ve.init.mw.ArticleTarget.prototype.saveErrorNewUser = function ( username ) {
* @method
* @param {Object} editApi
* @param {Object|null} data API response data
* @fires onSaveErrorUnknown
* @fires saveErrorUnknown
*/
ve.init.mw.ArticleTarget.prototype.saveErrorUnknown = function ( editApi, data ) {
var errorMsg = ( editApi && editApi.info ) ||
( data && data.error && data.error.info ) ||
( editApi && editApi.code ) ||
( data && data.error && data.error.code ) ||
'Unknown error';
this.showSaveError(
$( document.createTextNode(
( editApi && editApi.info ) ||
( data.error && data.error.info ) ||
( editApi && editApi.code ) ||
( data.error && data.error.code ) ||
'Unknown error'
) ),
$( document.createTextNode( errorMsg ) ),
false // prevents reapply
);
this.emit( 'onSaveErrorUnknown' );
this.emit( 'saveErrorUnknown', errorMsg );
};
/**

View file

@ -149,8 +149,8 @@ ve.init.mw.ArticleTargetEvents.prototype.trackSaveError = function ( type ) {
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;
if ( type === 'unknown' && failureArguments[ 1 ] ) {
data.message = failureArguments[ 1 ];
}
ve.track( 'mwedit.saveFailure', data );
};