mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
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:
parent
4ed6fd4010
commit
84d534997e
|
@ -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 );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue