diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js index 3de20cd427..2962bd5769 100644 --- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js @@ -744,8 +744,6 @@ ve.init.mw.ArticleTarget.prototype.saveFail = function ( doc, saveData, wasRetry return; } - editApi = ve.getProp( data, 'visualeditoredit', 'edit' ) || {}; - // Handle token errors if ( data.error && data.error.code === 'badtoken' ) { if ( wasRetry ) { @@ -782,6 +780,8 @@ ve.init.mw.ArticleTarget.prototype.saveFail = function ( doc, saveData, wasRetry return; } + editApi = ve.getProp( data, 'visualeditoredit', 'edit' ) || data.error || {}; + for ( name in saveErrorHandlerFactory.registry ) { handler = saveErrorHandlerFactory.lookup( name ); if ( handler.static.matchFunction( editApi ) ) { diff --git a/modules/ve-mw/init/ve.init.mw.SaveErrorHandler.js b/modules/ve-mw/init/ve.init.mw.SaveErrorHandler.js index 6bd99607ab..02fcf02f0c 100644 --- a/modules/ve-mw/init/ve.init.mw.SaveErrorHandler.js +++ b/modules/ve-mw/init/ve.init.mw.SaveErrorHandler.js @@ -26,7 +26,7 @@ OO.initClass( ve.init.mw.SaveErrorHandler ); * @static * @inheritable * @method - * @param {Object} editApi Edit API response + * @param {Object} editApi Edit API response, or error data * @return {boolean} */ ve.init.mw.SaveErrorHandler.static.matchFunction = null; @@ -37,7 +37,7 @@ ve.init.mw.SaveErrorHandler.static.matchFunction = null; * @static * @inheritable * @method - * @param {Object} editApi Edit API response + * @param {Object} editApi Edit API response, or error data * @param {ve.init.mw.ArticleTarget} target Target */ ve.init.mw.SaveErrorHandler.static.process = null;